qaz@lemmy.world to Programmer Humor@programming.devEnglish · edit-23 days agoSlapping on a .expect is also error handling!lemmy.worldimagemessage-square27fedilinkarrow-up1168arrow-down15file-text
arrow-up1163arrow-down1imageSlapping on a .expect is also error handling!lemmy.worldqaz@lemmy.world to Programmer Humor@programming.devEnglish · edit-23 days agomessage-square27fedilinkfile-text
minus-squarejubilationtcornpone@sh.itjust.workslinkfedilinkarrow-up14·3 days agotry { execute.SomeMethod(); } catch(Exception ex) {}
minus-squarer00ty@kbin.lifelinkfedilinkarrow-up1·2 days agoI’ve seen this in production code before. I might argue if you caught a very specific exception type that didn’t matter it might be acceptable. Maybe. But just the overall Exception type… Recipe for disaster.
try { execute.SomeMethod(); } catch(Exception ex) {}
I’ve seen this in production code before. I might argue if you caught a very specific exception type that didn’t matter it might be acceptable. Maybe. But just the overall Exception type… Recipe for disaster.
goto fail;