Skip to content

Commit

Permalink
Catch exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
fghoussen committed Sep 14, 2024
1 parent d4e0ba2 commit 8aafb3c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion EXAMPLES/MATRIX_MARKET/arpackmm.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <iostream>
#include <exception>
#include <chrono>

#include "arpackSolver.hpp"
Expand Down Expand Up @@ -834,7 +836,7 @@ int itrSolve(options& opt, output& out) {
return rc;
}

int main(int argc, char** argv) {
int run(int argc, char** argv) {
// Check for options.

options opt;
Expand Down Expand Up @@ -988,6 +990,17 @@ int main(int argc, char** argv) {
return 0;
}

int main(int argc, char** argv) {
int rc = 1;
try {
rc = run(argc, argv);
}
catch (exception& e) {
cout << "Error - exception:" << e.what() << endl;
}
return rc;
}

// Local Variables:
// mode: c++
// c-file-style:"stroustrup"
Expand Down

0 comments on commit 8aafb3c

Please sign in to comment.