diff options
author | Mark Spruiell <mes@zeroc.com> | 2004-01-16 22:22:44 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2004-01-16 22:22:44 +0000 |
commit | 00081d77200a08baac2e62cc2797c7530caacea3 (patch) | |
tree | 69a638dc86939389e9c810946a7d0fef20a31cd4 /cpp/src/FreezeScript/Exception.cpp | |
parent | adding ClassDef::isA (diff) | |
download | ice-00081d77200a08baac2e62cc2797c7530caacea3.tar.bz2 ice-00081d77200a08baac2e62cc2797c7530caacea3.tar.xz ice-00081d77200a08baac2e62cc2797c7530caacea3.zip |
initial check-in
Diffstat (limited to 'cpp/src/FreezeScript/Exception.cpp')
-rw-r--r-- | cpp/src/FreezeScript/Exception.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/cpp/src/FreezeScript/Exception.cpp b/cpp/src/FreezeScript/Exception.cpp new file mode 100644 index 00000000000..6d1eabb6f3d --- /dev/null +++ b/cpp/src/FreezeScript/Exception.cpp @@ -0,0 +1,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 +{ + 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; +} |