this post was submitted on 07 Mar 2024
311 points (100.0% liked)

196

17518 readers
379 users here now

Be sure to follow the rule before you head out.


Rule: You must post before you leave.



Other rules

Behavior rules:

Posting rules:

NSFW: NSFW content is permitted but it must be tagged and have content warnings. Anything that doesn't adhere to this will be removed. Content warnings should be added like: [penis], [explicit description of sex]. Non-sexualized breasts of any gender are not considered inappropriate and therefore do not need to be blurred/tagged.

If you have any questions, feel free to contact us on our matrix channel or email.

Other 196's:

founded 2 years ago
MODERATORS
 
top 7 comments
sorted by: hot top controversial new old
[–] ImplyingImplications 31 points 1 year ago

I wrote a small command line program that would crash if a keyboard interrupt was used to close it. I fixed the crash by catching the keyboard interrupt exception...but I couldn't do anything with it. The keyboard interrupt closes the program. Catching the interrupt only stopped the crash message from appearing. So my code basically looked like this.

[–] [email protected] 25 points 1 year ago (1 children)

Throw(e)

Make your problem someone else's problem.

[–] [email protected] 2 points 1 year ago

Wrap it in a RuntimeException and the compiler will be happy to.

[–] [email protected] 17 points 1 year ago
[–] [email protected] 9 points 1 year ago

That formatting, on the other hand, is not going away

[–] [email protected] 6 points 1 year ago

very true 😤👍

[–] [email protected] 3 points 1 year ago

Much like teeth … and friends