summaryrefslogtreecommitdiff
path: root/cpp/src/FreezeScript/Exception.cpp
blob: 91ef97390083e6e92e36ab6f8b035bbfd9a52f52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// **********************************************************************
//
// Copyright (c) 2004
// ZeroC, Inc.
// Billerica, MA, USA
//
// All Rights Reserved.
//
// Ice is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License version 2 as published by
// the Free Software Foundation.
//
// **********************************************************************

#include <FreezeScript/Exception.h>

using namespace std;

//
// Exception
//
FreezeScript::Exception::Exception(const char* file, int line, const string& reason) :
    IceUtil::Exception(file, line), _reason(reason)
{
}

string FreezeScript::Exception::_name = "FreezeScript::Exception";

const string&
FreezeScript::Exception::ice_name() const
{
    return _name;
}

void
FreezeScript::Exception::ice_print(ostream& out) const
{
	::IceUtil::Exception::ice_print(out);
    out << ":\nerror occurred during transformation"; // TODO
    if(!_reason.empty())
    {
        out << ":\n" << _reason;
    }
}

IceUtil::Exception*
FreezeScript::Exception::ice_clone() const
{
    return new Exception(ice_file(), ice_line(), _reason);
}

void
FreezeScript::Exception::ice_throw() const
{
    throw *this;
}

string
FreezeScript::Exception::reason() const
{
    return _reason;
}