|
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 "loggingexception.h" |
|
19 |
|
20 |
|
21 int LoggingException::RESOURCE_ALLOCATION_FAILURE = 1; |
|
22 int LoggingException::INVALID_LOG_FILENAME = 2; |
|
23 int LoggingException::UNKNOWN_IMAGE_TYPE = 3; |
|
24 |
|
25 |
|
26 LoggingException::LoggingException(int ErrorCode) |
|
27 { |
|
28 this->errcode = ErrorCode; |
|
29 |
|
30 return; |
|
31 } |
|
32 |
|
33 |
|
34 int LoggingException::GetErrorCode(void) |
|
35 { |
|
36 return this->errcode; |
|
37 } |
|
38 |
|
39 |
|
40 const char* LoggingException::GetErrorMessage(void) |
|
41 { |
|
42 if(this->errcode == LoggingException::RESOURCE_ALLOCATION_FAILURE) |
|
43 return "Not enough system resources to initialize logging module."; |
|
44 else if(this->errcode == LoggingException::INVALID_LOG_FILENAME) |
|
45 return "Invalid log filename as input."; |
|
46 else if(this->errcode == LoggingException::UNKNOWN_IMAGE_TYPE) |
|
47 return "the image type not supported."; |
|
48 // else if(this->errcode == CacheException::CACHE_IS_EMPTY) |
|
49 // return "Cache is empty."; |
|
50 // else if(this->errcode == CacheException::HARDDRIVE_FAILURE) |
|
51 // return "A hard drive failure occurred in Cache operations."; |
|
52 |
|
53 return "Undefined error type."; |
|
54 } |
|
55 |
|
56 |
|
57 LoggingException::~LoggingException(void) |
|
58 { |
|
59 return; |
|
60 } |