diff --git a/src/main.cpp b/src/main.cpp index a1f9772455..aaedc19c1b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,6 +17,8 @@ #include "input.h" #include "library.h" +#include "nlohmann/json.hpp" + #include #include #include @@ -30,6 +32,7 @@ #include #endif +using json = nlohmann_lmp::json; using namespace LAMMPS_NS; // for convenience @@ -90,6 +93,11 @@ int main(int argc, char **argv) finalize(); MPI_Abort(MPI_COMM_WORLD, 1); exit(1); + } catch (json::exception &je) { + fprintf(stderr, "\nJSON library error %d: %s\n", je.id, je.what()); + finalize(); + MPI_Abort(MPI_COMM_WORLD, 1); + exit(1); } catch (std::bad_alloc &ae) { fprintf(stderr, "C++ memory allocation failed: %s\n", ae.what()); finalize();