Changeset e6a122 for pcp/src/errors.c


Ignore:
Timestamp:
Apr 21, 2008, 2:19:24 PM (18 years ago)
Author:
Frederik Heber <heber@…>
Children:
f2ce71c
Parents:
36f85c
git-author:
Frederik Heber <heber@…> (04/18/08 15:25:05)
git-committer:
Frederik Heber <heber@…> (04/21/08 14:19:24)
Message:

Error(): Idea and code taken from TREMOLO, now prints line number and sourc file name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pcp/src/errors.c

    r36f85c re6a122  
    3131 * \param *SpecialData is a typeless pointer on special data for error treatment, here detailed error message.
    3232*/
    33 void Error(enum Errors error, const void *SpecialData)
     33void Error_in(enum Errors error, const void *SpecialData,
     34    const char *file, const int line)
    3435{
    3536  const char *const error_msg[] = {
    3637    "SomeError",
    37     "FileOpenParams\nUnable to open parameter file",
     38    "FileOpenParams\nUnable to open parameter file\n",
    3839    "InitReading\n",
    39     "MallocError\nUnable to allocate memory!",
     40    "MallocError\nUnable to allocate memory!\n",
    4041  };
    4142  int mytid;
    4243  MPI_Comm_rank(MPI_COMM_WORLD, &mytid);
    4344  fprintf(stderr, "\nProcess %i: ", mytid);
    44   fprintf(stderr, "It has occured an error (%i): %s\n", error, error_msg[error]);
     45  fprintf(stderr, "Error in file %s, line %d (%i): %s - ",
     46      file, line, (int)error, error_msg[error]);
    4547  switch (error) {
    4648  case InitReading:
Note: See TracChangeset for help on using the changeset viewer.