2013-11-08 19:59:47 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "util/exception.h"
|
2013-11-15 20:13:03 +00:00
|
|
|
#include "library/script_evaluator.h"
|
2013-11-08 19:59:47 +00:00
|
|
|
|
|
|
|
namespace lean {
|
|
|
|
/**
|
|
|
|
\brief Exception for wrapping errors produced by the Lua engine.
|
|
|
|
*/
|
2013-11-15 20:13:03 +00:00
|
|
|
class lua_exception : public script_exception {
|
2013-11-08 19:59:47 +00:00
|
|
|
private:
|
|
|
|
source m_source;
|
|
|
|
std::string m_file; // if source == File, then this field contains the filename that triggered the error.
|
|
|
|
unsigned m_line; // line number
|
|
|
|
public:
|
|
|
|
lua_exception(char const * lua_error);
|
2013-11-15 20:13:03 +00:00
|
|
|
virtual ~lua_exception();
|
|
|
|
virtual source get_source() const { return m_source; }
|
|
|
|
virtual char const * get_filename() const;
|
|
|
|
virtual unsigned get_line() const;
|
2013-11-08 19:59:47 +00:00
|
|
|
/** \brief Return error message without position information */
|
2013-11-15 20:13:03 +00:00
|
|
|
virtual char const * get_msg() const noexcept;
|
2013-11-08 19:59:47 +00:00
|
|
|
};
|
|
|
|
}
|