test for exceptions add example

This commit is contained in:
Axel Kohlmeyer
2020-09-14 17:01:28 -04:00
parent 4185608e92
commit a1b2f82107
4 changed files with 50 additions and 6 deletions

View File

@ -4266,10 +4266,10 @@ the failing MPI ranks to send messages.
* \param buf_size size of the provided string buffer
* \return 1 when all ranks had the error, 1 on a single rank error.
*/
int lammps_get_last_error_message(void *handle, char * buffer, int buf_size) {
int lammps_get_last_error_message(void *handle, char *buffer, int buf_size) {
#ifdef LAMMPS_EXCEPTIONS
LAMMPS * lmp = (LAMMPS *) handle;
Error * error = lmp->error;
LAMMPS *lmp = (LAMMPS *) handle;
Error *error = lmp->error;
if(!error->get_last_error().empty()) {
int error_type = error->get_last_error_type();