DicError.cc 5.01 KB
#include "DicError.hh"

std::string getErrorMsg(int error_code) {
        switch (error_code) {
                case AMDA_EXIT_OK:
                        return "";
                case AMDA_PARSE_COMMAND_LINE_KO:
                        return "Command line arguments not recognized";
                case AMDA_TYPE_DATA_UNKNOWN:
                        return "Type of Data not supported";
                case AMDA_FILEPROPERTIES_ERR:
                        return "Error in property file";
                case AMDA_INFORMATION_PARAM_ERR:
                        return "Parameter XML file not found or not well-formed or not valid";
                case AMDA_INFORMATION_REQUEST_ERR:
                        return "Request XML file error";
                case AMDA_PARAM_OUTPUT_ERR:
                        return "ParamOutput implementation not found";
                case AMDA_PROCESS_ERR:
                        return "Compilation abort or library load abort";
                case AMDA_PARAM_NOT_FOUND_ERR:
                        return "Parameter of ident ??? is not fond";
                case AMDA_PARAM_SOME_ERR:
                        return "Some ParamOutput are terminated successfully but not all.";
                case AMDA_OPER_NOT_ALLOWED:
                        return "Operation not allowed";
                case AMDA_ERROR_UNKNOWN:
                        return "Unknown error";

                case AMDA_LOCALFILE_READER:
                        return "LocalFile: Unknown file reader";
                case AMDA_LOCALFILE_TIMEPARAM:
                        return "LocalFile: Cannot find time parameter";
                case AMDA_OUTOFTIME_ERR:
                        return "LocalFile: Out of data time";
                        
            case AMDA_STAT_NOT_BOOL: 
                return "Only boolean parameters are handled by countTrue function";

                case AMDA_PARSER_TEST_ERROR:
                        return "Parser: At leat one error occured during test of the parser";

                case AMDA_ERROR_NOCONNECTION:
                        return "DD_server: No connection";
                case AMDA_ERROR_TOOMANYREQ:
                        return "DD_server: Too many request";
                case AMDA_ERROR_REQSENDERR:
                        return "DD_server: Error to send request";
                case AMDA_ERROR_REPLYRECERR:
                        return "DD_server: Receive an error";
                case AMDA_ERROR_NOID:
                        return "DD_server: Invalid request Id";
                case AMDA_ERROR_NOREFFILE:
                        return "DD_server: Error to open reference file";
                case AMDA_ERROR_NOTIMESFILE:
                        return "DD_server: Missing times file";
                case AMDA_ERROR_NOINFOFILE:
                        return "DD_server: Missing info file";
                case AMDA_ERROR_NOVAR:
                        return "DD_server: Unknwon variable";
                case AMDA_ERROR_OUTOFTIME:
                        return "DD_server: Out of data time";
                case AMDA_ERROR_CACHERR:
                        return "DD_server: Error occured during cache manipulation";
                case AMDA_ERROR_CACHTOOREC:
                        return "DD_server: No free space in cache";
                case AMDA_ERROR_WAITEXTCALL:
                        return "DD_server: Waits external call finish";
                case AMDA_ERROR_TRYAGAIN:
                        return "DD_server: Times file is locked. This request should be repeated again";
                case AMDA_ERROR_NODATAATTIME:
                        return "DD_server: Requested time is inside NODATA time interval";
                case AMDA_ERROR_GAPISSMALL:
                        return "DD_server: Gap is too small to call external archive";
                case AMDA_ERROR_CTIMEISSHIFTED:
                        return "DD_server: The request was in NoData interval, try again with time at the end";
                case AMDA_ERROR_DATAFILEERR:
                        return "DD_server: Error during data file manipulation";
                case AMDA_ERROR_ENVIRERROR:
                        return "DD_server: Error in environment variables";
                case AMDA_ERROR_NOPOINTER:
                        return "DD_server: The pointer points nowhere, SetTime were failed";
                case AMDA_ERROR_INTSERERR:
                        return "DD_server: Server internal error";
                case AMDA_ERROR_TIMEINEMPTY:
                        return "DD_server: No data for specified time interval";
                case AMDA_ERROR_NOEXEC:
                        return "DD_server: No executable";

                case AMDA_ERROR_OPERMISSION:
                        return "DD_server: Access - Permission denied";
                case AMDA_ERROR_NOHOST:
                        return "DD_server: Access - No host";
                case AMDA_ERROR_NNOUSERSFILE:
                        return "DD_server: Access - No user file";
        }

        return "Unknown error";
}