Unverified Commit 185eeaea authored by Richard Berger's avatar Richard Berger
Browse files

Add missing try-catch

parent 18bb4bfd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -506,9 +506,9 @@ void AngleTable::param_extract(Table *tb, char *line)
  tb->fpflag = 0;
  tb->theta0 = MY_PI;

  try {
    ValueTokenizer values(line);

  try {
    while (values.has_next()) {
      std::string word = values.next_string();

+19 −14
Original line number Diff line number Diff line
@@ -476,7 +476,9 @@ void BondTable::param_extract(Table *tb, char *line)
  tb->fpflag = 0;
  tb->r0 = 0.0;

  try {
    ValueTokenizer values(line);

    while (values.has_next()) {
      std::string word = values.next_string();

@@ -492,6 +494,9 @@ void BondTable::param_extract(Table *tb, char *line)
        error->one(FLERR,"Invalid keyword in bond table parameters");
      }
    }
  } catch(TokenizerException & e) {
    error->one(FLERR, e.what());
  }

  if (tb->ninput == 0) error->one(FLERR,"Bond table parameters did not set N");
}
+22 −18
Original line number Diff line number Diff line
@@ -557,6 +557,7 @@ void PairTable::param_extract(Table *tb, char *line)
  tb->rflag = NONE;
  tb->fpflag = 0;

  try {
    ValueTokenizer values(line);

    while (values.has_next()) {
@@ -577,6 +578,9 @@ void PairTable::param_extract(Table *tb, char *line)
        error->one(FLERR,fmt::format("Invalid keyword {} in pair table parameters", word).c_str());
      }
    }
  } catch (TokenizerException & e) {
    error->one(FLERR, e.what());
  }

  if (tb->ninput == 0) error->one(FLERR,"Pair table parameters did not set N");
}