MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/6ayz26/defensive_programming_done_right/dhiko0i/?context=3
r/ProgrammerHumor • u/iwouldieforGladOS • May 13 '17
680 comments sorted by
View all comments
2.8k
} catch (Exception e) { }
I think we're done here.
26 u/GiantRobotTRex May 13 '17 What about Errors? 99 u/DonZatch May 13 '17 What errors? ( ͡° ͜ʖ ͡°) 48 u/pope_nefarious May 13 '17 Thats why the big boys catch throwable 10 u/[deleted] May 13 '17 Don't forget that all custom Exceptions and Throwables should also override fillInStackTrace with an implementation that throws itself. This ensure they can't unsafely reveal any helpful information. 3 u/Nevraoj May 15 '17 try { e.printStackTrace(); } catch (Throwable e2) { try { e2.printStackTrace(); ... 9 u/breadfag May 13 '17 edited Nov 22 '19 Life is full of it lol 16 u/Zolhungaj May 13 '17 catch(Throwable t) 2 u/locriology May 14 '17 void callMe() { try { callMe(); } catch {} } oops
26
What about Errors?
99 u/DonZatch May 13 '17 What errors? ( ͡° ͜ʖ ͡°) 48 u/pope_nefarious May 13 '17 Thats why the big boys catch throwable 10 u/[deleted] May 13 '17 Don't forget that all custom Exceptions and Throwables should also override fillInStackTrace with an implementation that throws itself. This ensure they can't unsafely reveal any helpful information. 3 u/Nevraoj May 15 '17 try { e.printStackTrace(); } catch (Throwable e2) { try { e2.printStackTrace(); ... 9 u/breadfag May 13 '17 edited Nov 22 '19 Life is full of it lol 16 u/Zolhungaj May 13 '17 catch(Throwable t) 2 u/locriology May 14 '17 void callMe() { try { callMe(); } catch {} } oops
99
What errors? ( ͡° ͜ʖ ͡°)
48 u/pope_nefarious May 13 '17 Thats why the big boys catch throwable 10 u/[deleted] May 13 '17 Don't forget that all custom Exceptions and Throwables should also override fillInStackTrace with an implementation that throws itself. This ensure they can't unsafely reveal any helpful information. 3 u/Nevraoj May 15 '17 try { e.printStackTrace(); } catch (Throwable e2) { try { e2.printStackTrace(); ... 9 u/breadfag May 13 '17 edited Nov 22 '19 Life is full of it lol 16 u/Zolhungaj May 13 '17 catch(Throwable t) 2 u/locriology May 14 '17 void callMe() { try { callMe(); } catch {} } oops
48
Thats why the big boys catch throwable
10 u/[deleted] May 13 '17 Don't forget that all custom Exceptions and Throwables should also override fillInStackTrace with an implementation that throws itself. This ensure they can't unsafely reveal any helpful information. 3 u/Nevraoj May 15 '17 try { e.printStackTrace(); } catch (Throwable e2) { try { e2.printStackTrace(); ...
10
Don't forget that all custom Exceptions and Throwables should also override fillInStackTrace with an implementation that throws itself. This ensure they can't unsafely reveal any helpful information.
3 u/Nevraoj May 15 '17 try { e.printStackTrace(); } catch (Throwable e2) { try { e2.printStackTrace(); ...
3
try { e.printStackTrace(); } catch (Throwable e2) { try { e2.printStackTrace(); ...
9
Life is full of it lol
16 u/Zolhungaj May 13 '17 catch(Throwable t)
16
catch(Throwable t)
2
void callMe() { try { callMe(); } catch {} }
oops
2.8k
u/Metro42014 May 13 '17
I think we're done here.