2010-11-15 04:21:43 +01:00
|
|
|
/*****************************************************************************
|
2012-02-02 02:53:35 +01:00
|
|
|
*
|
2010-11-15 04:21:43 +01:00
|
|
|
* This file is part of Mapnik (c++ mapping toolkit)
|
|
|
|
*
|
2015-06-16 12:49:16 +02:00
|
|
|
* Copyright (C) 2015 Artem Pavlenko
|
2010-11-15 04:21:43 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2011-10-23 16:09:47 +02:00
|
|
|
#ifndef MAPNIK_VALUE_ERROR_HPP
|
|
|
|
#define MAPNIK_VALUE_ERROR_HPP
|
2010-11-15 04:21:43 +01:00
|
|
|
|
2013-05-10 03:22:40 +02:00
|
|
|
#include <mapnik/config.hpp>
|
|
|
|
|
2012-12-07 08:06:12 +01:00
|
|
|
#include <exception>
|
|
|
|
#include <string>
|
2010-11-15 04:21:43 +01:00
|
|
|
|
|
|
|
namespace mapnik {
|
|
|
|
|
2013-05-16 03:47:46 +02:00
|
|
|
class value_error : public std::exception
|
2010-11-15 04:21:43 +01:00
|
|
|
{
|
|
|
|
public:
|
2012-04-17 06:57:24 +02:00
|
|
|
value_error() :
|
|
|
|
what_() {}
|
2010-11-15 04:21:43 +01:00
|
|
|
|
2012-03-05 20:10:04 +01:00
|
|
|
value_error( std::string const& what ) :
|
2010-11-15 04:21:43 +01:00
|
|
|
what_( what )
|
|
|
|
{
|
|
|
|
}
|
2012-04-17 06:57:24 +02:00
|
|
|
|
2013-01-04 03:01:09 +01:00
|
|
|
virtual ~value_error() throw() {}
|
2010-11-15 04:21:43 +01:00
|
|
|
|
|
|
|
virtual const char * what() const throw()
|
|
|
|
{
|
2012-02-02 02:53:35 +01:00
|
|
|
return what_.c_str();
|
2010-11-15 04:21:43 +01:00
|
|
|
}
|
|
|
|
|
2012-03-05 20:10:04 +01:00
|
|
|
void append_context(std::string const& ctx) const
|
2010-11-15 04:21:43 +01:00
|
|
|
{
|
|
|
|
what_ += " " + ctx;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
mutable std::string what_;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2011-10-23 16:09:47 +02:00
|
|
|
#endif // MAPNIK_VALUE_ERROR_HPP
|