improve error messages

This commit is contained in:
Axel Kohlmeyer
2025-01-02 19:38:10 -05:00
parent 735606a0b5
commit f7cea5e428

View File

@ -308,7 +308,7 @@ void Update::set_units(const char *style)
neighbor->skin = 0.1;
} else
error->all(FLERR, "Illegal units command");
error->all(FLERR, "Unknown units style {}", style);
delete[] unit_style;
unit_style = utils::strdup(style);
@ -325,7 +325,7 @@ void Update::set_units(const char *style)
void Update::create_integrate(int narg, char **arg, int trysuffix)
{
if (narg < 1) error->all(FLERR, "Illegal run_style command");
if (narg < 1) utils::missing_cmd_args(FLERR, "run_style", error);
delete[] integrate_style;
delete integrate;
@ -390,14 +390,14 @@ void Update::new_integrate(char *style, int narg, char **arg, int trysuffix, int
return;
}
error->all(FLERR, "Illegal integrate style");
error->all(FLERR, "Unknown integrate style {}", style);
}
/* ---------------------------------------------------------------------- */
void Update::create_minimize(int narg, char **arg, int trysuffix)
{
if (narg < 1) error->all(FLERR, "Illegal minimize_style command");
if (narg < 1) utils::missing_cmd_args(FLERR, "minimize_style", error);
delete[] minimize_style;
delete minimize;
@ -457,7 +457,7 @@ void Update::new_minimize(char *style, int /* narg */, char ** /* arg */, int tr
return;
}
error->all(FLERR, "Illegal minimize style");
error->all(FLERR, "Unknown minimize style {}", style);
}
/* ----------------------------------------------------------------------