address issues flagged by coverity scan

This commit is contained in:
Axel Kohlmeyer
2025-03-15 21:38:18 -04:00
parent 73585e1dcc
commit 035aefcc26
4 changed files with 11 additions and 8 deletions

View File

@ -281,7 +281,13 @@ void utils::fmtargs_print(FILE *fp, fmt::string_view format, fmt::format_args ar
std::string utils::errorurl(int errorcode)
{
return fmt::format("\nFor more information see https://docs.lammps.org/err{:04d}", errorcode);
std::string url;
try {
url = fmt::format("\nFor more information see https://docs.lammps.org/err{:04d}", errorcode);
} catch (std::exception &) {
url = std::string("\nFor more information see https://docs.lammps.org/Errors_details.html");
}
return url;
}
void utils::flush_buffers(LAMMPS *lmp)