Commit 5a8c5eb4 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

provide last input command line with error->one() output

parent aa0d6cd7
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -152,9 +152,17 @@ void Error::all(const char *file, int line, const char *str)
void Error::one(const char *file, int line, const char *str)
{
  int me;
  const char *lastcmd = (const char*)"(unknown)";
  MPI_Comm_rank(world,&me);
  if (screen) fprintf(screen,"ERROR on proc %d: %s (%s:%d)\n",
                      me,str,file,line);

  if (input && input->line) lastcmd = input->line;
  if (screen) fprintf(screen,"ERROR on proc %d: %s (%s:%d)\n"
                      "Last command: %s\n",
                      me,str,file,line,lastcmd);
  if (logfile) fprintf(logfile,"ERROR on proc %d: %s (%s:%d)\n"
                       "Last command: %s\n",
                       me,str,file,line,lastcmd);

  if (universe->nworlds > 1)
    if (universe->uscreen)
      fprintf(universe->uscreen,"ERROR on proc %d: %s (%s:%d)\n",