diff --git a/src/utils.cpp b/src/utils.cpp index 94660f546a..4c48069afb 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -281,7 +281,11 @@ 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); + if (errorcode == 0) + return "\nFor more information see https://docs.lammps.org/Errors_details.html"; + else if (errorcode > 0) + return fmt::format("\nFor more information see https://docs.lammps.org/err{:04d}", errorcode); + else return ""; // negative numbers are reserved for future use pointing to a different URL } void utils::flush_buffers(LAMMPS *lmp) diff --git a/src/utils.h b/src/utils.h index 39dd58a79e..b403d78061 100644 --- a/src/utils.h +++ b/src/utils.h @@ -173,11 +173,12 @@ output are compressed to a single blank by calling :cpp:func:`strcompress()` * * The LAMMPS manual contains detailed explanations for errors and * warnings where a simple error message may not be sufficient. These can - * be reached through URLs with a numeric code. This function creates the + * be reached through URLs with a numeric code > 0. This function creates the * corresponding text to be included into the error message that redirects - * the user to that URL. + * the user to that URL. Using an error code of 0 returns a message + * pointing to a URL discussing error messages in general. * - * \param errorcode number pointing to a paragraph in the manual */ + * \param errorcode non-negative number pointing to a paragraph in the manual */ std::string errorurl(int errorcode);