main.cpp 258 B

1234567891011121314151617181920
  1. #include <util/generic/yexception.h>
  2. void Bar() {
  3. ythrow yexception() << "from Foo()";
  4. }
  5. void Foo() {
  6. try {
  7. Bar();
  8. } catch (...) {
  9. Cerr << "caught; rethrowing\n";
  10. throw;
  11. }
  12. }
  13. int main() {
  14. Foo();
  15. return 0;
  16. }