GME  13
PanicHandler.cpp
Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one or more
00003  * contributor license agreements.  See the NOTICE file distributed with
00004  * this work for additional information regarding copyright ownership.
00005  * The ASF licenses this file to You under the Apache License, Version 2.0
00006  * (the "License"); you may not use this file except in compliance with
00007  * the License.  You may obtain a copy of the License at
00008  * 
00009  *      http://www.apache.org/licenses/LICENSE-2.0
00010  * 
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 /*
00019  * $Id: PanicHandler.cpp 471747 2006-11-06 14:31:56Z amassari $
00020  */
00021 
00022 
00023 // ---------------------------------------------------------------------------
00024 //  Includes
00025 // ---------------------------------------------------------------------------
00026 #include <xercesc/util/PanicHandler.hpp>
00027 
00028 XERCES_CPP_NAMESPACE_BEGIN
00029 
00030 const char* PanicHandler::getPanicReasonString(const PanicReasons reason)
00031 {
00032     const char* reasonStr;
00033 
00034     switch (reason)
00035     {
00036     case Panic_NoTransService:
00037         reasonStr = "Could not load a transcoding service";
00038         break;
00039     case Panic_NoDefTranscoder:
00040         reasonStr = "Could not load a local code page transcoder";
00041         break;
00042     case Panic_CantFindLib:
00043         reasonStr = "Could not find the xerces-c DLL";
00044         break;
00045     case Panic_UnknownMsgDomain:
00046         reasonStr = "Unknown message domain";
00047         break;
00048     case Panic_CantLoadMsgDomain:
00049         reasonStr = "Cannot load message domain";
00050         break;
00051     case Panic_SynchronizationErr:
00052         reasonStr = "Cannot synchronize system or mutex";
00053         break;
00054     case Panic_SystemInit:
00055         reasonStr = "Cannot initialize the system or mutex";
00056         break;
00057     case Panic_MutexErr:
00058         reasonStr = "Cannot create, lock or unlock a mutex";
00059         break;
00060     default:
00061         reasonStr = "Unknown reason";
00062         break;
00063     }   
00064 
00065     return reasonStr;
00066 
00067 }
00068 
00069 XERCES_CPP_NAMESPACE_END
00070