2015-10-15 09:50:25 +00:00
|
|
|
/*
|
2016-11-18 23:13:20 +00:00
|
|
|
This file is part of solidity.
|
2015-10-15 09:50:25 +00:00
|
|
|
|
2016-11-18 23:13:20 +00:00
|
|
|
solidity is free software: you can redistribute it and/or modify
|
2015-10-15 09:50:25 +00:00
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
2016-11-18 23:13:20 +00:00
|
|
|
solidity is distributed in the hope that it will be useful,
|
2015-10-15 09:50:25 +00:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2016-11-18 23:13:20 +00:00
|
|
|
along with solidity. If not, see <http://www.gnu.org/licenses/>.
|
2015-10-15 09:50:25 +00:00
|
|
|
*/
|
|
|
|
/**
|
2015-10-15 12:36:23 +00:00
|
|
|
* @author Liana <liana@ethdev.com>
|
2015-10-15 09:50:25 +00:00
|
|
|
* @date 2015
|
|
|
|
* Solidity exception hierarchy.
|
|
|
|
*/
|
|
|
|
|
2015-10-20 22:21:52 +00:00
|
|
|
#include <libsolidity/interface/Exceptions.h>
|
|
|
|
#include <libsolidity/interface/Utils.h>
|
2015-10-15 09:50:25 +00:00
|
|
|
|
|
|
|
using namespace dev;
|
|
|
|
using namespace dev::solidity;
|
|
|
|
|
2015-10-15 12:36:23 +00:00
|
|
|
Error::Error(Type _type): m_type(_type)
|
2015-10-15 09:50:25 +00:00
|
|
|
{
|
|
|
|
switch(m_type)
|
|
|
|
{
|
2015-10-21 14:43:31 +00:00
|
|
|
case Type::DeclarationError:
|
|
|
|
m_typeName = "Declaration Error";
|
|
|
|
break;
|
|
|
|
case Type::DocstringParsingError:
|
|
|
|
m_typeName = "Docstring Parsing Error";
|
|
|
|
break;
|
|
|
|
case Type::ParserError:
|
|
|
|
m_typeName = "Parser Error";
|
|
|
|
break;
|
2016-01-14 01:58:09 +00:00
|
|
|
case Type::SyntaxError:
|
|
|
|
m_typeName = "Syntax Error";
|
|
|
|
break;
|
2015-10-21 14:43:31 +00:00
|
|
|
case Type::TypeError:
|
|
|
|
m_typeName = "Type Error";
|
|
|
|
break;
|
2015-10-27 16:45:58 +00:00
|
|
|
case Type::Why3TranslatorError:
|
|
|
|
m_typeName = "Why3 Translator Error";
|
2015-10-21 14:43:31 +00:00
|
|
|
break;
|
|
|
|
case Type::Warning:
|
|
|
|
m_typeName = "Warning";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
solAssert(false, "");
|
|
|
|
break;
|
2015-10-15 09:50:25 +00:00
|
|
|
}
|
|
|
|
}
|