home *** CD-ROM | disk | FTP | other *** search
/ Graphics 16,000 / graphics-16000.iso / msdos / utils / graphtal.lzh / Graphtal.Amiga / Error.C < prev    next >
C/C++ Source or Header  |  1992-11-20  |  1KB  |  49 lines

  1. /*
  2.  * Error.C - general error reporting function.
  3.  *
  4.  * Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
  5.  *                     University of Berne, Switzerland
  6.  * Copyright (C) 1989, 1991, Craig E. Kolb
  7.  * All rights reserved.
  8.  *
  9.  * This software may be freely copied, modified, and redistributed
  10.  * provided that this copyright notice is preserved on all copies.
  11.  *
  12.  * You may not distribute this software, in whole or in part, as part of
  13.  * any commercial product without the express consent of the authors.
  14.  *
  15.  * There is no warranty or other guarantee of fitness of this software
  16.  * for any purpose.  It is provided solely "as is".
  17.  *
  18.  * Adapted from Craig Kolbs rayshade.
  19.  */
  20.  
  21. #include <stdlib.h>
  22. #include <stream.h>
  23. #include "Error.h"
  24. #include "Options.h"
  25.  
  26. void Error(errorType level, const rcString& msg)
  27. {
  28.   switch(level) {
  29.     case ERR_ADVISE:
  30.       if (!theOptions.quiet)
  31.     cerr << "Warning: " << msg << ".\n";
  32.       break;
  33.     case ERR_WARN:
  34.       cerr << "Warning: " << msg << ".\n";
  35.       break;
  36.     case ERR_ABORT:
  37.       cerr << "Error: " << msg << "!\n";
  38.       exit(1);
  39.       break;
  40.     case ERR_PANIC:
  41.       cerr << "Fatal error: " << msg << "!\n";
  42.       exit(2);
  43.       break;
  44.     default:
  45.       cerr << "Unknown error: " << msg << ".\n";
  46.       exit(3);
  47.     }
  48. }
  49.