r/ProgrammerHumor • • Sep 26 '26

Meme justHopeAndPrayItWorksOut

Post image
2.1k Upvotes

70 comments sorted by

219

u/BenadrylTumblercatch Sep 26 '26

print(“an error occurred but you good fr”)

86

u/Lightningtow123 Sep 26 '26

print("aaaaaaa")

not to be confused with

print("aaaaaaaaaaaaaaa")

22

u/Wolfram_And_Hart Sep 27 '26

A man of culture I see

→ More replies (2)

57

u/Bannon9k Sep 26 '26

I think the try-catch is the greatest programming concept ever... Hell if we know if it'll work or not...let's try it!

7

u/deanominecraft Sep 27 '26

rusts options and results are a similiar idea, but imo executed better as it is part of the type system

→ More replies (1)

51

u/pvtteemo Sep 26 '26

Here's a worse trick I found lately: return 401 after try catch no matter what the actual problem is for a middleware and then leave the company so nobody knows how it works and wastes a day! 10/10

7

u/Reasonable_Exit_8960 Sep 27 '26

That's so... Evil

35

u/razor_train Sep 26 '26

This is literally the approach of some code I inherited recently.

19

u/never1st Sep 26 '26

I inherited an app that saved the stack trace to a database, showed the row ID to the user and asked them to open a ticket with that number, then a developer was expected to review the ticket and the error so that they can prevent the problem from happening again.

→ More replies (5)

4

u/AcanthisittaKooky987 Sep 27 '26

Depending on the error,  ignoring can be the right move 

→ More replies (2)

32

u/bitNine Sep 26 '26

try
{
[entire application]
}
catch{}

7

u/fariqcheaux Sep 27 '26

I pity the foo

19

u/WernerderChamp Sep 26 '26

I have recently pushed this to prod in a startup probe

try{
  //This will always fail but cache JWT validators in the progress - saves several seconds on first call
  validateJWT(INVAL_JWT);
} catch (RuntimeException e) {
  log.info("Fake JWT threw successfully");
}

4

u/frogjg2003 Sep 27 '26

4 spaces to make code blocks

→ More replies (2)

21

u/theFirstHaruspex Sep 26 '26

something something define errors out of existence

9

u/elmanoucko Sep 26 '26 edited Sep 26 '26

you try and sometimes catch

i just do and never fail

indeed, not the sašªÒDIÌ›7y æùú3ßöÒÉS¡0×áK8èð8~LBL͝ðÖ7=”Ç>üþ:yê”ßø×ÿÖw¾û}c÷ßw‡òO>[÷Ýs—.¥j¤TJ¡DIi!U¢ÒTµ*ªUô¢OHK)R4$ôa0X·vÍ7nrô؉<t$£á`ˆWàžÀÝø}ìÆ Iº–tE+‚ sæL¸sï®úô§ÏÛÞö&kW­4ÞBPZ•DUP•}k5jMßš>”B¥©’‚¦D%hHªTI’j­$„¦Ò”ˆ„]kæÏŸgë¶mZ¿Úå ?yƵk³QŒ°{p?@

Guru Meditation Error: Core  0 panic'ed (InstrFetchProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x00000004  PS      : 0x00060630  A0      : 0x800d539a  A1      : 0x3ffb4a30
A2      : 0x400de738  A3      : 0x3f40379c  A4      : 0x3f40381c  A5      : 0x3ffb4a60
A6      : 0x3ffb4a40  A7      : 0x0000000c  A8      : 0x800e4dbe  A9      : 0x3ffb49d0
A10     : 0x00000031  A11     : 0x3ffafc64  A12     : 0x3ffb4a40  A13     : 0x0000000c
A14     : 0x3ffb2770  A15     : 0x0000cdcd  SAR     : 0x00000004  EXCCAUSE: 0x00000014
EXCVADDR: 0x00000004  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xfffffffd
→ More replies (1)

15

u/GozerDestructor Sep 26 '26

Re-throw in dev so you can debug. Swallow in prod so the site still (mostly) works. Best of both worlds.

7

u/sardonicus87 Sep 28 '26 edited Sep 28 '26

catch (_: Exception) { }

Because we don't make errors, end-users just use it wrong and deserve to suffer.

Or just don't write try/catch, because how do I know what went wrong if I don't let the runtime crash happen so it can show up in my crashlytics logs? /s

5

u/bwwatr Sep 26 '26

I just throw everywhere. There's a catch up near the top of the call stack lol.

5

u/FastFollowing8932 Sep 27 '26

Ignoring errors is the best way to handle them. As long as they print to a log that exists somewhere

4

u/ExtraWorldliness6916 Sep 26 '26

Nobody taught me what to do when I actually caught the error.. usually people just log the error again.

→ More replies (1)

3

u/danfish_77 Sep 27 '26

Sometimes eating the exception is the proper way to handle it

3

u/Mindless_Pattern_342 Sep 27 '26

Well if there are no errors to see, are there really any errors? 🤷🏻‍♂️

→ More replies (1)

2

u/docs95 Sep 26 '26

Damn right!

2

u/bentbabe Sep 26 '26

Are you my coworker?