aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/terminate_handler/sample/exception/main.cpp
blob: e764101d0e2f938665d4b69ef6433746fdf54f04 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <util/generic/yexception.h> 
 
 
void Foo(unsigned i = 0) { 
    if (i >= 10) { 
        ythrow yexception() << "from Foo()"; 
    } else { 
        Foo(i + 1); 
    } 
} 
 
int main() { 
    Foo(); 
    return 0; 
}