Matrix Science header

ms_errors.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_errors.hpp                                                        #
00004 # 'msparser' toolkit                                                         #
00005 # Encapsulates a general-purpose error object that collects information      #
00006 # about several consecutive erros                                            #
00007 ##############################################################################
00008 # COPYRIGHT NOTICE                                                           #
00009 # Copyright 1998-2003 Matrix Science Limited  All Rights Reserved.           #
00010 #                                                                            #
00011 ##############################################################################
00012 #    $Archive:: /Mowse/ms_mascotresfile/include/ms_errors.hpp              $ #
00013 #     $Author: davidc $ #
00014 #       $Date: 2017/05/04 13:34:05 $ #
00015 #   $Revision: 1.104 $ #
00016 # $NoKeywords::                                                            $ #
00017 ##############################################################################
00018 */
00019 
00020 #ifndef MS_ERRORS_HPP
00021 #define MS_ERRORS_HPP
00022 
00023 #ifdef _WIN32
00024 #pragma warning(disable:4251)   // Don't want all classes to be exported
00025 #pragma warning(disable:4786)   // Debug symbols too long
00026 #   ifndef _MATRIX_USE_STATIC_LIB
00027 #       ifdef MS_MASCOTRESFILE_EXPORTS
00028 #           define MS_MASCOTRESFILE_API __declspec(dllexport)
00029 #       else
00030 #           define MS_MASCOTRESFILE_API __declspec(dllimport)
00031 #       endif
00032 #   else
00033 #       define MS_MASCOTRESFILE_API
00034 #   endif
00035 #else
00036 #   define MS_MASCOTRESFILE_API
00037 #endif
00038 
00039 // for the sake of #include <string>
00040 #ifdef __ALPHA_UNIX__
00041 #include <ctype.h>
00042 #endif
00043 
00044 #include <cstdarg>
00045 #include <vector>
00046 #include <string>
00047 
00048 /*
00049 #include <istream>
00050 #include <strstream>
00051 #include <fstream>
00052 */
00053 namespace matrix_science {
00059 
00060     class MS_MASCOTRESFILE_API ms_errs
00061     {
00062     public:
00064 
00068         enum msg_sev {
00069             sev_fatal   = 1,  
00070             sev_warn    = 2,  
00071             sev_info    = 3,  
00072             sev_debug1  = 4,  
00073             sev_debug2  = 5,  
00074             sev_debug3  = 6   
00075         };
00076 
00078 
00091         enum err
00092         {
00093             // errors for result files
00094             ERR_NO_ERROR                        = 0x0000, 
00095             ERR_NOMEM                           = 0x0001, 
00096             ERR_NOSUCHFILE                      = 0x0002, 
00097             ERR_READINGFILE                     = 0x0003, 
00098             ERR_QUERYOUTOFRANGE                 = 0x0004, 
00099             ERR_MISSINGENTRY                    = 0x0005, 
00100             ERR_PEPSUMMPEPGET                   = 0x0006, 
00101             ERR_PEPTIDESTR                      = 0x0007, 
00102             ERR_ACCINPEPTIDESTR                 = 0x0008, 
00103             ERR_PROTSUMM                        = 0x0009, 
00104             ERR_PROTSUMMPEP                     = 0x000A, 
00105             ERR_ADDPEPTIDES                     = 0x000B, 
00106             ERR_MISSINGHIT                      = 0x000C, 
00107             ERR_MISSINGSECTION                  = 0x000D, 
00108             ERR_MISSINGSECTIONEND               = 0x000E, 
00109             ERR_MALFORMED_ERR_TOL               = 0x000F, 
00110             ERR_NO_ERR_TOL_PARENT               = 0x0010, 
00111             ERR_NULL_ACC_PEP_SUM                = 0x0011, 
00112             ERR_NULL_ACC_PROT_SUM               = 0x0012, 
00113             ERR_DUPE_ACCESSION                  = 0x0013, 
00114             ERR_UNASSIGNED_PROG                 = 0x0014, 
00115             ERR_UNASSIGNED_RANGE                = 0x0015, 
00116             ERR_UNASSIGNED_UNK                  = 0x0016, 
00117             ERR_NO_UNIGENE_FILE                 = 0x0017, 
00118             ERR_DUPLICATE_KEY                   = 0x0018, 
00119             ERR_OLDRESULTSFILE                  = 0x0019, 
00120             ERR_MALFORMED_TAG                   = 0x001A, 
00121             ERR_MALFORMED_DRANGE                = 0x001B, 
00122             ERR_INVALID_NUMQUERIES              = 0x001C, 
00123             ERR_MALFORMED_TERMS                 = 0x001D, 
00124             ERR_INVALID_RESFILE                 = 0x001E, 
00125             ERR_INVALID_PROTDB                  = 0x001F, 
00126             ERR_UNIGENE_MULTIDB                 = 0x0020, 
00127             ERR_INVALID_CACHE_DIR               = 0x0021, 
00128             ERR_FAIL_OPEN_DAT_FILE              = 0x0022, 
00129             ERR_MISSING_CDB_FILE                = 0x0023, 
00130             ERR_FAIL_MK_CACHE_DIR               = 0x0024, 
00131             ERR_FAIL_MK_CDB_FILE                = 0x0025, 
00132             ERR_FAIL_CLOSE_FILE                 = 0x0026, 
00133             ERR_FAIL_CDB_INIT                   = 0x0027, 
00134             ERR_INVALID_CDB_FILE                = 0x0028, 
00135             ERR_WRITE_CDB_FILE                  = 0x0029, 
00136             ERR_CDB_TOO_LARGE                   = 0x002A, 
00137             ERR_NEED_64_BIT                     = 0x002B, 
00138             ERR_CDB_64_BIT_REMAKE               = 0x002C, 
00139             ERR_CDB_OLD_VER_RETRY               = 0x002D, 
00140             ERR_CDB_OLD_VER_NO_RETRY            = 0x002E, 
00141             ERR_CDB_INCOMPLETE_RETRY            = 0x002F, 
00142             ERR_CDB_INCOMPLETE_NO_RETRY         = 0x0030, 
00143             ERR_CDB_BEING_CREATED               = 0x0031, 
00144             ERR_CDB_FAIL_REMOVE                 = 0x0032, 
00145             ERR_CDB_FAIL_LOCK                   = 0x0033, 
00146             ERR_CDB_FAIL_UNLOCK                 = 0x0034, 
00147             ERR_CDB_SOURCE_CHANGE_RETRY         = 0x0035, 
00148             ERR_CDB_SOURCE_CHANGE_NO_RETRY      = 0x0036, 
00149             ERR_MISSING_PERCOLATOR_FILE         = 0x0037, 
00150             ERR_CANNOT_APPEND_RESFILE           = 0x0038, 
00151             ERR_CANNOT_APPEND_RESFILE_NO_FNAMES = 0x0039, 
00152             ERR_RESULTS_NOT_CREATED             = 0x003A, 
00153             // End of errors for ms_mascotresfile. Above errors are duplicated in ms_mascotresfile.hpp
00154             // After fixing bug 11415, should not be necessary to add more errors into the list above.
00155 
00156             // OS errors
00157             ERR_MSP_FAILED_TO_OPEN_FILE         = 0x0100, 
00158             ERR_MSP_FAILED_TO_CLOSE_FILE        = 0X0101, 
00159             ERR_MSP_FAIL_STAT                   = 0x0102, 
00160             ERR_MSP_GET_VOLUME_INFO             = 0x0103, 
00161             ERR_MSP_FILE_DOESNT_EXIST           = 0x0104, 
00162             ERR_MSP_FAIL_GET_PROCESS_AFFINITY   = 0x0105, 
00163             ERR_MSP_SYSMP_FAIL                  = 0x0106, 
00164             ERR_MSP_FAIL_GET_SYSINFO            = 0x0107, 
00165             ERR_MSP_FAILED_TO_WRITE_FILE        = 0x0108, 
00166             ERR_MSP_FAIL_UTIME                  = 0x0109, 
00167 
00168             // fragmentation rules file related errors
00169             ERR_MSP_FRAGMENTATION_RULES         = 0x0200, 
00170 
00171             // masses file related errors
00172             ERR_MSP_IN_MASSES_FILE              = 0x0300, 
00173             ERR_MSP_INVALID_MASS_IN_MASSES_FILE = 0x0301, 
00174 
00175             // mod_file related errors
00176             ERR_MSP_DUPLICATE_MOD               = 0x0400, 
00177             ERR_MSP_RESIDUE_AND_TERMINUS_MOD    = 0x0401, 
00178             ERR_MSP_TOO_MANY_MODS_IN_MOD_FILE   = 0x0402, 
00179             ERR_MSP_NO_COMMAS_IN_MOD_NAME       = 0x0403, 
00180             ERR_MSP_IN_MODS_FILE                = 0x0404, 
00181             ERR_MSP_MISSING_DEFINITION_END      = 0x0405, 
00182             ERR_MSP_NO_SUCH_MOD                 = 0x0406, 
00183 
00184             // enzymes file related errors
00185             ERR_MSP_ENZYME_FILE_FORMAT          = 0x0500, 
00186             ERR_MSP_MISSING_ENZYME_TITLE        = 0x0501, 
00187             ERR_MSP_ENZYME_DEFINITION_PROBLEM   = 0x0502, 
00188             ERR_MSP_ENZYME_TOO_MANY_RULES       = 0x0503, 
00189 
00190             // mascot.dat file related errors
00191             ERR_MSP_MISSING_MASCOT_DAT          = 0x0601, 
00192             ERR_MSP_DB_USES_MISSING_RULE        = 0x0602, 
00193             ERR_MSP_COMPILE_PARSE_RULE          = 0x0603, 
00194             ERR_MSP_NEED_1_EXP_IN_PARSE_RULE    = 0x0604, 
00195             ERR_MSP_IN_MASCOT_DAT_DB_SECT       = 0x0605, 
00196             ERR_MSP_IN_OPTIONS_SECTION          = 0x0606, 
00197             ERR_MSP_IN_CLUSTER_SECTION          = 0x0607, 
00198             ERR_MSP_TOO_MANY_CPUS_IN_SUB_CLUSTER = 0x0608,
00199             ERR_MSP_CRON_TOO_MANY_JOBS          = 0x0609, 
00200             ERR_MSP_INVALID_PARSE_RULE          = 0x060A, 
00201             ERR_MSP_INVALID_PARSE_RULE_NO       = 0x060B, 
00202             ERR_MSP_RULE_NO_ALREADY_DEFINED     = 0x060C, 
00203             ERR_MSP_MISSING_QUOTE_IN_PARSE_RULE = 0x060D, 
00204             ERR_MSP_PARSE_LEN_EXCEED            = 0x060E, 
00205             ERR_MSP_IN_TAXONOMY_SECTION         = 0x060F, 
00206             ERR_MSP_INCOMPATIBLE_TAX_RULES      = 0x0610, 
00207             ERR_MSP_MAX_PREFIX_REMOVES          = 0x0611, 
00208             ERR_MSP_MAX_SUFFIX_REMOVES          = 0x0612, 
00209             ERR_MSP_MAX_TAX_NO_BREAKS           = 0x0613, 
00210             ERR_MSP_CRON_INVALID_CHAR           = 0x0614, 
00211             ERR_MSP_CRON_INVALID_NUMBER         = 0x0615, 
00212             ERR_MSP_CRON_INVALID_STAR           = 0x0616, 
00213             ERR_MSP_CRON_NO_NUM_BEFORE_COMMA    = 0x0617, 
00214             ERR_MSP_CRON_NO_NUM_BEFORE_MINUS    = 0x0618, 
00215             ERR_MSP_INVALID_PROCESSOR_LINE      = 0x0619, 
00216             ERR_MSP_PROCESSOR_NOT_IN_SET        = 0x061A, 
00217             ERR_MSP_SPECIFY_UNAVAILABLE_PROCESSOR= 0x061B,
00218             ERR_MSP_TOO_MANY_PROCESSORS         = 0x061C, 
00219             ERR_MSP_TOO_MANY_TH_PROCESSORS      = 0x061D, 
00220             ERR_MSP_WWW_SECTION                 = 0x061E, 
00221             ERR_MSP_DUP_TAXONOMYRULE            = 0x061F, 
00222             ERR_MSP_WRONG_ICAT_FILTER           = 0x0620, 
00223             ERR_MSP_EXEC_AFTER_SEARCH_INVALID   = 0x0621, 
00224             ERR_MSP_EXEC_AFTER_SEARCH_DEPENDS   = 0x0622, 
00225             ERR_MSP_EXEC_AFTER_SEARCH_LOGGING   = 0x0623, 
00226             ERR_MSP_REPORTBUILDERCOLARR_INVALID = 0x0624, 
00227             ERR_MSP_UNEXPECTED_LINE_OUT_OF_SECT = 0x0625, 
00228             ERR_MSP_MISSING_SECTION             = 0x0626, 
00229             ERR_MSP_NO_REGEX_MATCH              = 0x0627, 
00230             ERR_MSP_REGEX_ERROR                 = 0x0627, 
00231             ERR_MSP_COLOURSCHEME_INVALID        = 0x0628, 
00232 
00233             // license file related errors
00234             ERR_MSP_NO_LICENSE_FILE             = 0x0700, 
00235             ERR_MSP_LICENSE_DES_CHECKSUM        = 0x0701, 
00236             ERR_MSP_LICENSE_LINE_CHECKSUM       = 0x0702, 
00237             ERR_MSP_LICENSE_NOT_YET_AVAIL       = 0x0703, 
00238             ERR_MSP_LICENSE_EXPIRED             = 0x0704, 
00239             ERR_MSP_LICENSE_INTERNAL_CONFIG     = 0x0705, 
00240             ERR_MSP_LICENSE_LINE_INVALID        = 0x0706, 
00241 
00242             ERR_MSP_XML_SYSTEM_FAILED           = 0x0801, 
00243             ERR_MSP_XML_NO_ROOT_ELEMENT         = 0x0802, 
00244             ERR_MSP_XML_TABLE_NOTFOUND          = 0x0803, 
00245             ERR_MSP_XML_FIELD_NOTFOUND          = 0x0804, 
00246             ERR_MSP_XML_INVALID_FIELD_FORMAT    = 0x0805, 
00247             ERR_MSP_XML_LOCAL_SCHEMA_NOT_STORED = 0x0806, 
00248             ERR_MSP_XML_ELEMENT_NOT_FOUND       = 0x0807, 
00249             ERR_MSP_XML_MEMORY_ERROR            = 0x0808, 
00250 
00251             ERR_MSP_HTTP_TRANSMISSION_FAILED    = 0x0901, 
00252             ERR_MSP_HTTP_INVALID_URL            = 0x0902, 
00253             ERR_MSP_MASCOT_NOT_RUNNING          = 0x0903, 
00254             // Removed at version 2.5 
00255             // ERR_MSP_HTTP_WININET_FAILED      = 0x0904, //!< [F] Wininet failure.
00256 
00257             ERR_MSP_CONFLICT_BETWEEN_MODS       = 0x0A01, 
00258             ERR_MSP_WRONG_MOD_VECTOR            = 0x0A02, 
00259             ERR_MSP_MOD_MUST_BE_VAR             = 0x0A03, 
00260             ERR_MSP_MALFORMED_PEPTIDE           = 0x0A04, 
00261             ERR_MSP_DOUBLE_CHARGE_NOT_ALLOWED   = 0x0A05, 
00262             ERR_MSP_NO_ENZYME_SET               = 0x0A06, 
00263             ERR_MSP_EMPTY_MOD                   = 0x0A07, 
00264 
00265             ERR_MSP_TAXONOMY_NO_TITLE           = 0x0B01, 
00266             ERR_MSP_TAXONOMY_NO_COMMAS          = 0x0B02, 
00267             ERR_MSP_TAXONOMY_WRONG_LINE         = 0x0B03, 
00268             ERR_MSP_TAXONOMY_DEFINITION_END     = 0x0B04, 
00269             ERR_MSP_TAXONOMY_CONFLICT_PARENTS   = 0x0B05, 
00270             ERR_MSP_TAXONOMY_INVALID_NODE_FILE  = 0x0B06, 
00271             ERR_MSP_TAXONOMY_MISSING_NODE_FILE  = 0x0B07, 
00272 
00273             // Security related errors
00274             ERR_MSP_SECURITY_INVALID_SESSION_ID = 0x1000, 
00275             ERR_MSP_SECURITY_NOT_ADMIN_SESSION  = 0x1001, 
00276             ERR_MSP_SECURITY_DUPE_USER_ID       = 0x1002, 
00277             ERR_MSP_SECURITY_DUPE_USER_NAME     = 0x1003, 
00278             ERR_MSP_SECURITY_BAD_USER_NAME      = 0x1004, 
00279             ERR_MSP_SECURITY_USERNAME_NOT_FOUND = 0x1005, 
00280             ERR_MSP_SECURITY_USERID_NOT_FOUND   = 0x1006, 
00281             ERR_MSP_SECURITY_DUPE_GROUP_ID      = 0x1007, 
00282             ERR_MSP_SECURITY_DUPE_GROUP_NAME    = 0x1008, 
00283             ERR_MSP_SECURITY_BAD_GROUP_NAME     = 0x1009, 
00284             ERR_MSP_SECURITY_GROUPNAME_NOT_FOUND= 0x100A, 
00285             ERR_MSP_SECURITY_GROUPID_NOT_FOUND  = 0x100B, 
00286             ERR_MSP_SECURITY_FAIL_LOAD_SEC      = 0x100C, 
00287             ERR_MSP_SECURITY_FAIL_LOAD_USER     = 0x100D, 
00288             ERR_MSP_SECURITY_FAIL_LOAD_GROUP    = 0x100E, 
00289             ERR_MSP_SECURITY_DEL_SPECIAL_GROUP  = 0x100F, 
00290             ERR_MSP_SECURITY_DEL_SPECIAL_USER   = 0x1010, 
00291             ERR_MSP_SECURITY_DISABLE_ADMIN      = 0x1011, 
00292             ERR_MSP_SECURITY_DEL_ADMIN_RIGHTS   = 0x1012, 
00293             ERR_MSP_SECURITY_DEL_ADMIN_FROM_GP  = 0x1013, 
00294             ERR_MSP_SECURITY_DUPE_GROUP_NAME_U  = 0x1014, 
00295             ERR_MSP_SECURITY_DUPE_USER_NAME_U   = 0x1015, 
00296             ERR_MSP_SECURITY_OLD_PW_INVALID     = 0x1016, 
00297             ERR_MSP_SECURITY_NO_GUEST_PWD       = 0x1017, 
00298             ERR_MSP_SECURITY_PASSWORD_TOO_SHORT = 0x1018, 
00299             ERR_MSP_SECURITY_FAIL_SAVE_SEC      = 0x1019, 
00300             ERR_MSP_SECURITY_NO_RIGHTS_UPD_USR  = 0x101A, 
00301             
00302             ERR_MSP_SECURITY_INVALIDUSER        = 0x1101, 
00303             ERR_MSP_SECURITY_INVALIDPASSWORD    = 0x1102, 
00304             ERR_MSP_SECURITY_MISSINGSESSIONFILE = 0x1103, 
00305             ERR_MSP_SECURITY_SAVESESSIONFILE    = 0x1104, 
00306             ERR_MSP_SECURITY_TIMEDOUT           = 0x1105, 
00307             ERR_MSP_SECURITY_DIFFERENTIPADDR    = 0x1106, 
00308             ERR_MSP_SECURITY_PASSWORDEXPIRED    = 0x1107, 
00309             ERR_MSP_SECURITY_NOTLOGGEDIN        = 0x1108, 
00310             ERR_MSP_SECURITY_INVALIDSESSION     = 0x1109, 
00311             ERR_MSP_SECURITY_NOSAVEPARAMS       = 0x110A, 
00312             ERR_MSP_SECURITY_SESSIONDESTROYED   = 0x110B, 
00313             ERR_MSP_SECURITY_NOCREATEGUEST      = 0x110C, 
00314             ERR_MSP_SECURITY_UPDATESESS         = 0x110D, 
00315             ERR_MSP_SECURITY_ACCOUNT_DISABLED   = 0x110E, 
00316             ERR_MSP_SECURITY_NOTNORMALUSER      = 0x110F, 
00317             ERR_MSP_SECURITY_SAMEPASSWORD       = 0x1110, 
00318             ERR_MSP_SECURITY_SPOOFATTEMPT1      = 0x1111, 
00319             ERR_MSP_SECURITY_SPOOFATTEMPT2      = 0x1112, 
00320             ERR_MSP_SECURITY_SPOOFATTEMPT3      = 0x1113, 
00321             ERR_MSP_SECURITY_SPOOFATTEMPT4      = 0x1114, 
00322             ERR_MSP_SECURITY_FAILGETINTEGRAURL  = 0x1115, 
00323             ERR_MSP_SECURITY_FAILGETINTEGRA     = 0x1116, 
00324             ERR_MSP_SECURITY_INTEGRACONNFORMAT  = 0x1117, 
00325             ERR_MSP_SECURITY_INTEGRAINVALIDPW   = 0x1118, 
00326             ERR_MSP_SECURITY_INTEGRAINVALIDCO   = 0x1119, 
00327             ERR_MSP_SECURITY_LOADSESSIONFILE    = 0x111A, 
00328             ERR_MSP_SECURITY_NOT_INTEGRA_USER   = 0x111B, 
00329             ERR_MSP_SECURITY_NOT_ENABLED        = 0x111C, 
00330             ERR_MSP_SECURITY_NO_INTEGRA_LOGIN   = 0x111D, 
00331             ERR_MSP_SESSION_UTIME_FAIL          = 0x111E, 
00332             ERR_MSP_SECURITY_CMDLINE_CGI        = 0x111F, 
00333 
00334 
00335             // Security logging messages
00336             ERR_MSP_SECURITY_ADDUSER            = 0x1200, 
00337             ERR_MSP_SECURITY_DELUSER            = 0x1201, 
00338             ERR_MSP_SECURITY_UPDATEUSER         = 0x1202, 
00339             ERR_MSP_SECURITY_UPDATEPW           = 0x1203, 
00340             ERR_MSP_SECURITY_ADDGROUP           = 0x1204, 
00341             ERR_MSP_SECURITY_DELETEGROUP        = 0x1205, 
00342             ERR_MSP_SECURITY_UPDATEGROUP        = 0x1206, 
00343 
00344             ERR_MSP_SECURITY_GETALLGROUPIDS     = 0x1300, 
00345             ERR_MSP_SECURITY_GETGROUPOK         = 0x1301, 
00346             ERR_MSP_SECURITY_GETGROUPFAIL       = 0x1302, 
00347             ERR_MSP_SECURITY_GETUSEROK          = 0x1303, 
00348             ERR_MSP_SECURITY_GETUSERFAIL        = 0x1304, 
00349             ERR_MSP_SECURITY_GETUSERFROMIDOK    = 0x1305, 
00350             ERR_MSP_SECURITY_GETUSERFROMIDFAIL  = 0x1306, 
00351             ERR_MSP_SECURITY_GETALLUSERIDS      = 0x1307, 
00352             ERR_MSP_SECURITY_GETGROUPFROMIDOK   = 0x1308, 
00353             ERR_MSP_SECURITY_GETGROUPFROMIDFAIL = 0x1309, 
00354             ERR_MSP_SECURITY_GETPERMTASKSOK     = 0x130A, 
00355             ERR_MSP_SECURITY_GETPERMTASKSFAIL   = 0x130B, 
00356             ERR_MSP_SECURITY_UPDATEALLSESSFILES = 0x130C, 
00357             ERR_MSP_SECURITY_GETINTEGRAUSERS1   = 0x130D, 
00358             ERR_MSP_SECURITY_GETINTEGRAUSERS2   = 0x130E, 
00359             ERR_MSP_SECURITY_GETINTEGRAUSERS3   = 0x130F, 
00360             ERR_MSP_SECURITY_VALIDATEINTEGRAPW1 = 0x1310, 
00361             ERR_MSP_SECURITY_VALIDATEINTEGRAPW2 = 0x1311, 
00362             ERR_MSP_SECURITY_VALIDATEINTEGRAPW3 = 0x1312, 
00363             ERR_MSP_SECURITY_VALIDATEINTEGRACO1 = 0x1313, 
00364             ERR_MSP_SECURITY_VALIDATEINTEGRACO2 = 0x1314, 
00365 
00366             ERR_MSP_SECURITY_MSSESSIONCTOR      = 0x1330, 
00367             ERR_MSP_SECURITY_MSSESSCOOKIE       = 0x1331, 
00368             ERR_MSP_SECURITY_LOADINGSESS        = 0x1332, 
00369             ERR_MSP_SECURITY_MSSESSLOGIN        = 0x1333, 
00370             ERR_MSP_SECURITY_MSSESSINTEGRA      = 0x1334, 
00371             ERR_MSP_SECURITY_MSSESSRESULTSPERM  = 0x1335, 
00372 
00373             ERR_MSP_QUANT_FAILEDLOAD            = 0x1400, 
00374             ERR_MSP_QUANT_FAILEDSAVE            = 0x1401, 
00375 
00376             ERR_MSP_QUANT_HELPER_FAILEDINIT     = 0x1410, 
00377 
00378             ERR_MSP_QUANTITATION_FAILEDINIT     = 0x1420, 
00379             ERR_MSP_QUANTITATION_NOMETHOD       = 0x1421, 
00380             ERR_MSP_QUANTITATION_BADMETHOD      = 0x1422, 
00381             ERR_MSP_QUANTITATION_BADCOMPONENT   = 0x1423, 
00382 
00383             ERR_MSP_MS2QUANTITATION_FAILEDINIT  = 0x1430, 
00384             ERR_MSP_MS2QUANTITATION_NORM_NO_SUM = 0x1431, 
00385             ERR_MSP_MS2QUANTITATION_NORM_UNIMP  = 0x1432, 
00386             ERR_MSP_MS2QUANTITATION_PROTWEIGH   = 0x1433, 
00387             ERR_MSP_MS2QUANTITATION_PROTR_UNIM  = 0x1434, 
00388             ERR_MSP_MS2QUANTITATION_COMPONENTS  = 0x1442, 
00389             ERR_MSP_MS2QUANTITATION_QUERY_SECS  = 0x1443, 
00390 
00391             ERR_MSP_CUSTQUANTITATION_FAILEDINIT = 0x1440, 
00392             ERR_MSP_CUSTQUANTITATION_PROTR_UNIM = 0x1441, 
00393 
00394             ERR_MSP_MS1QUANTITATION_HITREF_NEW  = 0x1450, 
00395             ERR_MSP_MS1QUANTITATION_HITREF_DROP = 0x1451, 
00396             ERR_MSP_MS1QUANTITATION_FAILEDINIT  = 0x1452, 
00397 
00398             ERR_MSP_UMOD_FAILEDLOAD             = 0x1500, 
00399             ERR_MSP_UMOD_FAILEDSAVE             = 0x1501, 
00400 
00401             ERR_MSP_XMLSCHEMA_FAILEDLOAD        = 0x1600, 
00402             ERR_MSP_XMLSCHEMA_FAILEDSAVE        = 0x1601, 
00403 
00404             ERR_MSP_ZIP_ENDIAN                  = 0x1700, 
00405             ERR_MSP_ZIP_OUTOFMEMORY             = 0x1701, 
00406             ERR_MSP_ZIP_BUFTOOSMALL             = 0x1702, 
00407             ERR_MSP_ZIP_INVALIDDATA             = 0x1703, 
00408             ERR_MSP_ZIP_UNKNOWN                 = 0x1704, 
00409             ERR_MSP_ZIP_LENGTHDIFFERS           = 0x1705, 
00410             ERR_MSP_ZIP_UNCOMPRESSEDDATATOOLONG = 0x1706, 
00411             ERR_MSP_ZIP_ZEROLENGTH              = 0x1707, 
00412             ERR_MSP_ZIP_VERSIONERROR            = 0x1708, 
00413             ERR_MSP_ZIP_NOTSTREAMING            = 0x1709, 
00414             ERR_MSP_ZIP_STREAMERROR             = 0x1710, 
00415 
00416             // Installer logging messages
00417             ERR_MSP_INST_LOGICALPERPHYSICALCPU  = 0x1800, 
00418             ERR_MSP_INST_INVALIDCPUINFO         = 0x1801, 
00419             ERR_MSP_INST_NUMTHREADS             = 0x1802, 
00420             ERR_MSP_INST_NOTMASCOTDATOK         = 0x1803, 
00421             ERR_MSP_INST_MASCOTDATOK            = 0x1804, 
00422             ERR_MSP_INST_APPENDTAXONOMY         = 0x1805, 
00423             ERR_MSP_INST_ADDINGDATABASE         = 0x1806, 
00424             ERR_MSP_INST_MISSINGDATABASE        = 0x1807, 
00425             ERR_MSP_INST_CHANGEDBTAXONOMY       = 0x1808, 
00426             ERR_MSP_INST_APPENDPARSERULE        = 0x1809, 
00427             ERR_MSP_INST_FAILADDPARSERULE       = 0x180A, 
00428             ERR_MSP_INST_ADDOPTIONSSECTION      = 0x180B, 
00429             ERR_MSP_INST_SETOPTIONSSECTION      = 0x180C, 
00430             ERR_MSP_INST_CLUSTERSECTION         = 0x180D, 
00431             ERR_MSP_INST_CANTGETHOSTNAME        = 0x180E, 
00432             ERR_MSP_INST_NOSUBCLUSTERSET        = 0x180F, 
00433             ERR_MSP_INST_CHANGEPARSERULE        = 0x1810, 
00434             ERR_MSP_INST_SAVEDPOSTINSTALLFILE   = 0x1811, 
00435             ERR_MSP_INST_FAILSAVEPOSTINSTALLFILE= 0x1812, 
00436 
00437             ERR_MSP_HTTP_WEBAUTHERROR           = 0x1901, 
00438             ERR_MSP_HTTP_VERSIONERROR           = 0x1902, 
00439             ERR_MSP_HTTP_MISSINGLOGINERROR      = 0x1903, 
00440             ERR_MSP_HTTP_MISSINGLOGININFO       = 0x1904, 
00441             ERR_MSP_HTTP_LOGINPARSERERROR       = 0x1905, 
00442             ERR_MSP_HTTP_LOGINPARSERERRORINT    = 0x1906, 
00443             ERR_MSP_HTTP_LOGINSERVERERROR       = 0x1907, 
00444             ERR_MSP_HTTP_LOGINSERVERERRORINT    = 0x1908, 
00445             ERR_MSP_HTTP_LOGINERROR             = 0x1909, 
00446             ERR_MSP_HTTP_LOGINERRORINT          = 0x190A, 
00447             ERR_MSP_HTTP_CHANGEPASSWORDDISABLED = 0x190B, 
00448             ERR_MSP_HTTP_OPENOUTPUTFILEFAILED   = 0x190C, 
00449             ERR_MSP_HTTP_WRITEOUTPUTFILEFAILED  = 0x190D, 
00450             ERR_MSP_HTTP_RELOGINFAILED          = 0x190E, 
00451 
00452             ERR_MSP_HTTP_SETPROXYFAILED         = 0x1A01, 
00453             ERR_MSP_HTTP_SETPROXYUSERNAMEFAILED = 0x1A02, 
00454             ERR_MSP_HTTP_SETPROXYPASSWORDFAILED = 0x1A03, 
00455             ERR_MSP_HTTP_SETHTTPUSERNAMEFAILED  = 0x1A04, 
00456             ERR_MSP_HTTP_SETHTTPPASSWORDFAILED  = 0x1A05, 
00457             ERR_MSP_HTTP_SETREDIRECTFAILED      = 0x1A06, 
00458             ERR_MSP_HTTP_URLSTRING              = 0x1A07, 
00459             ERR_MSP_HTTP_NORESPONSE             = 0x1A08, 
00460             ERR_MSP_HTTP_QUERYSTATUSRESULT      = 0x1A09, 
00461             ERR_MSP_HTTP_QUERYSTATUSFAILED      = 0x1A0A, 
00462             ERR_MSP_HTTP_OPENSESSIONFAILED      = 0x1A0B, 
00463             ERR_MSP_HTTP_OPENCONNECTIONFAILED   = 0x1A0C, 
00464             ERR_MSP_HTTP_OPENREQUESTFAILED      = 0x1A0D, 
00465             ERR_MSP_HTTP_CLOSESESSIONFAILED     = 0x1A0B, 
00466             ERR_MSP_HTTP_CLOSECONNECTIONFAILED  = 0x1A0C, 
00467             ERR_MSP_HTTP_CLOSEREQUESTFAILED     = 0x1A0D, 
00468             ERR_MSP_HTTP_ABORTEDBYUSER          = 0x1A0E, 
00469             ERR_MSP_HTTP_MAXCONECTIONSFAILED    = 0x1A0F, 
00470             ERR_MSP_HTTP_MAXCONECTIONS10FAILED  = 0x1A10, 
00471             ERR_MSP_HTTP_READRESPONSEFAILED     = 0x1A11, 
00472             ERR_MSP_HTTP_SENDREQUESTFAILED      = 0x1A12, 
00473             ERR_MSP_HTTP_QUERYDATAFAILED        = 0x1A13, 
00474             ERR_MSP_HTTP_READDATAFAILED         = 0x1A14, 
00475             ERR_MSP_HTTP_GETPROXYFAILED         = 0x1A15, 
00476             ERR_MSP_HTTP_BADHTTPSTATUS          = 0x1A16, 
00477             ERR_MSP_HTTP_ERROR                  = 0x1A17, 
00478             ERR_MSP_HTTP_SESSIONALREADYOPEN     = 0x1A18, 
00479             ERR_MSP_HTTP_GETRETURNSTRING        = 0x1A19, 
00480             ERR_MSP_HTTP_GETRESULTSFILENAME     = 0x1A1A, 
00481 
00482             ERR_MSP_CACHE_OPENFAILED            = 0x1B01, 
00483             ERR_MSP_CACHE_READFAILED            = 0x1B02, 
00484             ERR_MSP_CACHE_INVALIDFORMAT         = 0x1B03, 
00485             ERR_MSP_CACHE_SIGNATUREINVALID      = 0x1B04, 
00486             ERR_MSP_CACHE_DATAOFFSETINVALID     = 0x1B05, 
00487             ERR_MSP_CACHE_FILESEEKFAILED        = 0x1B06, 
00488             ERR_MSP_CACHE_INVALIDVERSION        = 0x1B07, 
00489             ERR_MSP_CACHE_INVALIDSTREAMID       = 0x1B08, 
00490             ERR_MSP_CACHE_INVALIDSTREAMPOSITION = 0x1B09, 
00491             ERR_MSP_CACHE_DUPLICATESTREAMID     = 0x1B0A, 
00492             ERR_MSP_CACHE_WRITEFAILED           = 0x1B0B, 
00493             ERR_MSP_CACHE_STREAMNOTFOUND        = 0x1B0C, 
00494             ERR_MSP_CACHE_WRITETRUNCATED        = 0x1B0D, 
00495             ERR_MSP_CACHE_MODIFYREADONLYMODE    = 0x1B0D, 
00496             ERR_MSP_CACHE_MODIFYCLOSED          = 0x1B0E, 
00497             ERR_MSP_CACHE_UNINITIALISEDSTREAM   = 0x1B0F, 
00498             ERR_MSP_CACHE_SLREF_UPDATE          = 0x1B10, 
00499 
00500             ERR_MSP_HTTP_XMLUPLOADFAILED        = 0x1C01, 
00501 
00502             ERR_MSP_NIST_MSP_INVALID_LINE       = 0x1D01, 
00503             ERR_MSP_NIST_MSP_MISSING_PARAMETER  = 0x1D02, 
00504             ERR_MSP_NIST_MSP_NO_SPECTRA         = 0x1D03, 
00505             ERR_MSP_NIST_MSP_NO_CREATE_CDB      = 0x1D04, 
00506             ERR_MSP_NIST_MSP_INCONSISTENT_MODS  = 0x1D05, 
00507             ERR_MSP_NIST_FAILED_TO_LOAD_ENTRY   = 0x1D06, 
00508             ERR_MSP_NIST_SAVE_ZERO_SPECTRA      = 0x1D07, 
00509             ERR_MSP_NIST_NO_PEAKS_IN_SPECTRUM   = 0x1D08, 
00510             ERR_MSP_NIST_CANNOT_ANNOTATE_PEAK   = 0x1D09, 
00511             ERR_MSP_NIST_INDEX_OUT_OF_RANGE     = 0x1D0A, 
00512 
00513             ERR_RESFILE_INVALID_DB_TYPE         = 0x1E01, 
00514 
00515             ERR_MSP_SL_SCORING_MODEL_FAIL       = 0x1F01, 
00516             ERR_MSP_SL_SCORING_MODEL_WARN       = 0x1F02, 
00517 
00518             ERR_MSP_LASTONE                     = 0x7FFFFFFF
00519 
00520         }; // enum err
00521 
00522     public:
00524         ms_errs();
00525 
00527         bool isValid() const;
00528 
00529 #ifndef SWIG
00530         // Internal usage only
00531         void setError(const int error, ...);
00532 
00533         // Internal usage only
00534         void vsetError(const int error, va_list argptr);
00535 
00536         // Internal usage only
00537         void setError(const std::string sessionID,
00538                       const int userID,
00539                       const int error, ...);
00540 
00541         // Internal usage only
00542         void setErrorPlusErrno(const int errorNumber, ...);
00543 
00544         bool anyIoErrors(FILE *f) const;
00545 
00546         // Internal usage only
00547         void appendError(const int errorNum, const int numRepeats, const std::string & errorString);
00548 
00549  #ifdef _WIN32
00550         // Internal usage only
00551         static std::string systemErrorText(unsigned winErrNum);
00552  #endif
00553 
00554 #endif
00555 
00557         void appendErrors(const ms_errs& src);
00558 
00560         int  getNumberOfErrors() const;
00561 
00563         void clearAllErrors();
00564 
00566         int  getErrorNumber(const int num = -1) const;
00567 
00569         int  getLastError() const;
00570 
00572         std::string getErrorString(const int num) const;
00573 
00575         std::string getLastErrorString() const;
00576 
00578         msg_sev getErrorSeverity(const int num = -1) const;
00579 
00581         int getErrorRepeats(const int num = -1) const;
00582 
00584         void setLoggingFile(const std::string filename, const msg_sev level);
00585 
00587         std::string getLoggingFileName() const;
00588 
00590         msg_sev getLoggingLevel() const;
00591 
00593         void setLoggingLevel(const msg_sev level);
00594 
00596         bool getCombineRepeats() const;
00597 
00599         void setCombineRepeats(const bool flag);
00600         
00602         static std::string _lookUpError(const int error, ms_errs::msg_sev & severity);
00603 
00604     private:
00605         
00606         void _setError(const int error, const char* strBuffer, 
00607                        const msg_sev severity,
00608                        const std::string & sessionID = "",
00609                        const int userID = -1);
00610 
00611         std::vector<int> errorNumbers_;
00612         std::vector<std::string>errorStrings_; // Will include 'user' data
00613         std::vector<msg_sev> errorSeverities_;
00614         std::vector<int> errorRepeats_;        // So that we don't get multiple errors
00615         std::string logfileName_;
00616         msg_sev loglevel_;
00617         bool combineRepeats_;
00618     }; // class ms_errs
00619 
00620 
00621 
00623     class MS_MASCOTRESFILE_API ms_errors
00624     {
00625     public:
00627         ms_errors();
00628 
00630         ~ms_errors();
00631 
00633         void copyFrom(const ms_errors* right);
00634 
00636         void appendErrors(const ms_errors& src);
00637 
00639         void clearAllErrors();
00640 
00642         bool isValid() const;
00643 
00645         std::string getLastErrorString() const;
00646 
00648         int getLastError() const;
00649 
00651         const ms_errs* getErrorHandler() const;
00652 
00653         ms_errs* getErrorHandler();
00654 
00655     protected:
00656         void appendError(const int errorNum, const int numRepeats, const std::string & errorString);
00657         ms_errs   err_; // error object that does all the work
00658     }; // end of error_handling_group
00660 } // namespace matrix_science
00661 
00662 #endif // MS_ERRORS_HPP
00663 
00664 /*------------------------------- End of File -------------------------------*/
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51