3 ms·
"Bubbling up" is the default in C++, when the code you call throws an exception and you don't have a try/catch for it.
by Rygian 5y ago
"Bubbling up" is the default in C++, when the code you call throws an exception and you don't have a try/catch for it.
- taneq 5y agoDo C++ people actually call it "bubbling up"? I don't think I've used a language where this isn't the default behaviour so I'm not sure I've ever heard it given an actual name, it's just what happens when you don't catch the exception - it keeps going until someone does catch it, or it hits the runtime and demolishes your program.
- dgritsko 5y agoI've heard "propagating" the exception used as well.
- taneq 5y agoNow that you mention it, I think this is the term I've heard for it when it has been mentioned. The exception propagates upwards.
- NavinF 5y agoYes, but not just in C++. Bubbling up errors is a common phrase in Java and Python.
- mynameisash 5y agoI often use and hear "bubbling up" in non-tech discussions, too. It's not at all uncommon, IMO.
- metadat 5y agoBubbling is what my guts do when they're unhappy. Not a great programming term.
- jeroenhd 5y agoI've heard this term more often in JS contexts than in C++ contexts, to be honest. I don't think C++ programmers use the term all that often, though the reference to error propagation will probably be understood anyway.