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.
6 Comments
ImplyingImplications@lemmy.ca · 28 pts · 2y
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.
quinkin@lemmy.world · 25 pts · 2y
Throw(e)
Make your problem someone else's problem.
jbk@discuss.tchncs.de · 2 pts · 2y
Wrap it in a
RuntimeExceptionand the compiler will be happy to.PM_ME_VINTAGE_30S@lemmy.sdf.org · 15 pts · 2y
We were on the verge of greatness. We were this close.
wander1236@sh.itjust.works · 9 pts · 2y
That formatting, on the other hand, is not going away
splitz@lemm.ee · 2 pts · 2y
Much like teeth … and friends