imgtools/romtools/rofsbuild/src/logging/loggingexception.cpp
changeset 708 0757c2976f96
parent 707 ccd52fece6ff
parent 706 5221386d044b
child 709 1ec2202bb75b
equal deleted inserted replaced
707:ccd52fece6ff 708:0757c2976f96
     1 /*
       
     2 * Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #include "logging/loggingexception.hpp"
       
    19 
       
    20 
       
    21 int LoggingException::RESOURCE_ALLOCATION_FAILURE = 1;
       
    22 int LoggingException::INVALID_LOG_FILENAME        = 2;
       
    23 
       
    24 
       
    25 LoggingException::LoggingException(int ErrorCode)
       
    26 {
       
    27 	this->errcode = ErrorCode;
       
    28 
       
    29 	return;
       
    30 }
       
    31 
       
    32 
       
    33 int LoggingException::GetErrorCode(void)
       
    34 {
       
    35 	return this->errcode;
       
    36 }
       
    37 
       
    38 
       
    39 const char* LoggingException::GetErrorMessage(void)
       
    40 {
       
    41 	if(this->errcode == LoggingException::RESOURCE_ALLOCATION_FAILURE)
       
    42 		return "Not enough system resources to initialize logging module.";
       
    43 	else if(this->errcode == LoggingException::INVALID_LOG_FILENAME)
       
    44 		return "Invalid log filename as input.";
       
    45 //	else if(this->errcode == CacheException::CACHE_INVALID)
       
    46 //		return "Cache is invalid.";
       
    47 //	else if(this->errcode == CacheException::CACHE_IS_EMPTY)
       
    48 //		return "Cache is empty.";
       
    49 //	else if(this->errcode == CacheException::HARDDRIVE_FAILURE)
       
    50 //		return "A hard drive failure occurred in Cache operations.";
       
    51 
       
    52 	return "Undefined error type.";
       
    53 }
       
    54 
       
    55 
       
    56 LoggingException::~LoggingException(void)
       
    57 {
       
    58 	return;
       
    59 }