1 |
|
2 |
/******************************************************* |
3 |
* |
4 |
* Copyright (c) 2003-2008 by University of Queensland |
5 |
* Earth Systems Science Computational Center (ESSCC) |
6 |
* http://www.uq.edu.au/esscc |
7 |
* |
8 |
* Primary Business: Queensland, Australia |
9 |
* Licensed under the Open Software License version 3.0 |
10 |
* http://www.opensource.org/licenses/osl-3.0.php |
11 |
* |
12 |
*******************************************************/ |
13 |
|
14 |
|
15 |
#include "EsysAssertException.h" |
16 |
#include <sstream> |
17 |
|
18 |
|
19 |
using namespace esysUtils; |
20 |
|
21 |
const std::string |
22 |
EsysAssertException::exceptionNameValue("EsysAssertException"); |
23 |
|
24 |
|
25 |
const std::string & |
26 |
EsysAssertException::exceptionName() const |
27 |
{ |
28 |
return exceptionNameValue; |
29 |
} |
30 |
|
31 |
|
32 |
|
33 |
void |
34 |
EsysAssertException::assertFailure (const std::string& assertion, |
35 |
const std::string& date, const std::string& file, |
36 |
int line, const std::string& errDesc) |
37 |
{ |
38 |
std::stringstream message; |
39 |
|
40 |
message << std::endl |
41 |
<< "EsysAssert(" << assertion << ") failed with message - " |
42 |
<< std::endl |
43 |
<< "\"" << errDesc << "\"" << std::endl |
44 |
<< "Assertion is located in File : " << file |
45 |
<< " at Line: " << line << std::endl |
46 |
<< "File Compilation Date: " << date << std::endl; |
47 |
|
48 |
throw EsysAssertException(message.str()); |
49 |
} |