From e463cfd3cbd419dc38583fe25b93be36b330a606 Mon Sep 17 00:00:00 2001 From: Gaspar Fernandez Date: Fri, 12 Aug 2016 01:29:28 +0200 Subject: Version 0.4d --- src/errors.cpp | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 src/errors.cpp (limited to 'src/errors.cpp') diff --git a/src/errors.cpp b/src/errors.cpp new file mode 100644 index 0000000..a884233 --- /dev/null +++ b/src/errors.cpp @@ -0,0 +1,128 @@ +#include +#include "errors.h" + +using namespace std; + +int verbose_level=DEFAULT_VERBOSE; + +/************************************************************* + * Function: error_handler * + ************************************************************* + * Description: * + * Shows error message on the screen and abort execution * + * of the program. * + * * + * Input: * + * int err_code - Which error? * + * char *add_string - Some errors may display additional * + * information. * + * * + * Change History: * + * Date Author Modification * + * * + *************************************************************/ +void error_handler (int err_code, char *add_string) +{ + if (err_code==OKAY) + { + return; // Does nothing + } + else + { + switch (err_code) + { + case ERR_NODISPLAY: + cout<<"Couldn't open display."; + break; + case ERR_XPMERROR: + cout<<"Couldn't load XPM image"; + break; + case ERR_BADFONT: + cout<<"Couldn't load desired font: "<