mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-10-31 15:20:13 +00:00
view: catch exception on Visual constructor #378
This commit is contained in:
parent
5a8107b788
commit
e7d0ce72dd
@ -173,7 +173,14 @@ int main(int argc, char** argv){
|
||||
std::array<char, 128> errbuf;
|
||||
int frames = 0;
|
||||
int averr;
|
||||
auto ncv = std::make_unique<Visual>(argv[i], &averr, 1, 0, stretchmode);
|
||||
std::unique_ptr<Visual> ncv;
|
||||
try{
|
||||
ncv = std::make_unique<Visual>(argv[i], &averr, 1, 0, stretchmode);
|
||||
}catch(std::exception& e){
|
||||
nc.stop();
|
||||
std::cerr << argv[i] << ": " << e.what() << "\n";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if(!ncv){
|
||||
av_make_error_string(errbuf.data(), errbuf.size(), averr);
|
||||
nc.stop();
|
||||
|
Loading…
Reference in New Issue
Block a user