feat(shell/lean): trap 'std::bad_alloc' and print nicer error message
See #489
This commit is contained in:
parent
47e37a3353
commit
68d4978953
1 changed files with 3 additions and 0 deletions
|
@ -604,6 +604,9 @@ int main(int argc, char ** argv) {
|
|||
return ok ? 0 : 1;
|
||||
} catch (lean::throwable & ex) {
|
||||
lean::display_error(diagnostic(env, ios), nullptr, ex);
|
||||
} catch (std::bad_alloc & ex) {
|
||||
std::cerr << "out of memory" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue