From 04d30329145047c0df69573a1ecd9ba35ef09cdb Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 1 Mar 2023 20:41:13 -0500 Subject: [PATCH] improve error messages --- src/read_data.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/read_data.cpp b/src/read_data.cpp index 59db1b6937..6785e51ecc 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -1985,7 +1985,8 @@ void ReadData::paircoeffs() next = strchr(buf, '\n'); *next = '\0'; parse_coeffs(buf, nullptr, 1, 2, toffset, tlabelflag, lmap->lmap2lmap.atom); - if (ncoeffarg == 0) error->all(FLERR, "Unexpected empty line in PairCoeffs section"); + if (ncoeffarg == 0) + error->all(FLERR, "Unexpected empty line in PairCoeffs section. Expected {} lines.", ntypes); force->pair->coeff(ncoeffarg, coeffarg); buf = next + 1; } @@ -2016,7 +2017,9 @@ void ReadData::pairIJcoeffs() next = strchr(buf, '\n'); *next = '\0'; parse_coeffs(buf, nullptr, 0, 2, toffset, tlabelflag, lmap->lmap2lmap.atom); - if (ncoeffarg == 0) error->all(FLERR, "Unexpected empty line in PairCoeffs section"); + if (ncoeffarg == 0) + error->all(FLERR, "Unexpected empty line in PairIJCoeffs section. " + "Expected {} lines.", (ntypes-1)*ntypes); force->pair->coeff(ncoeffarg, coeffarg); buf = next + 1; } @@ -2045,7 +2048,8 @@ void ReadData::bondcoeffs() next = strchr(buf, '\n'); *next = '\0'; parse_coeffs(buf, nullptr, 0, 1, boffset, blabelflag, lmap->lmap2lmap.bond); - if (ncoeffarg == 0) error->all(FLERR, "Unexpected empty line in BondCoeffs section"); + if (ncoeffarg == 0) + error->all(FLERR, "Unexpected empty line in BondCoeffs section. Expected {} lines.", nbondtypes); force->bond->coeff(ncoeffarg, coeffarg); buf = next + 1; }