r/ProgrammerHumor • • Jul 20 '18

Every Time

Post image
52.2k Upvotes

749 comments sorted by

View all comments

Show parent comments

14

u/Kalabasa Jul 20 '18

You can modify the exception's stack trace before throwing.

9

u/[deleted] Jul 20 '18

Wait really? I’ve never seen that or thought to do that before. I guess if people ever do that it’s usually to help debug rather than modify it with malicious intent

10

u/Kalabasa Jul 20 '18

Yeah, at least in Java. I guess it's for frameworks to hide internal stuff (cut off the part of the trace

4

u/citewiki Jul 20 '18

Cutting off... like the parenthes

1

u/[deleted] Jul 20 '18

Ah right yeah, didn’t think about that. Makes sense

2

u/[deleted] Jul 20 '18

Hmm I guess I know where that's useful now ...