more smaller fixes
[supertux.git] / src / scripting / squirrel_error.hpp
1 #ifndef __SQUIRREL_ERROR_HPP__
2 #define __SQUIRREL_ERROR_HPP__
3
4 #include <squirrel.h>
5 #include <stdexcept>
6
7 namespace Scripting
8 {
9
10 /** Exception class for squirrel errors, it takes a squirrelvm and uses
11  * sq_geterror() to retrieve additional information about the last error that
12  * occured and creates a readable message from that.
13  */
14 class SquirrelError : public std::exception
15 {
16 public:
17   SquirrelError(HSQUIRRELVM v, const std::string& message) throw();
18   virtual ~SquirrelError() throw();
19
20   const char* what() const throw();
21 private:
22   std::string message;
23 };
24
25 }
26
27 #endif
28