1 // -*- Mode: C++; tab-width:2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi:tw=80:et:ts=2:sts=2
3 //
4 // -----------------------------------------------------------------------
5 //
6 // This file is part of RLVM, a RealLive virtual machine clone.
7 //
8 // -----------------------------------------------------------------------
9 //
10 // Copyright (C) 2006 Elliot Glaysher
11 //
12 // This program is free software; you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation; either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
25 //
26 // -----------------------------------------------------------------------
27 
28 #ifndef SRC_SYSTEMS_BASE_SYSTEM_ERROR_H_
29 #define SRC_SYSTEMS_BASE_SYSTEM_ERROR_H_
30 
31 #include <exception>
32 #include <string>
33 
34 // Kill the program Errors. This exception class should only be used
35 // in cases where there is corrupted state or something; most things
36 // that a bad opcode could do should not fall under this class, and
37 // should be rlvm::Exception instead.
38 class SystemError : public std::exception {
39  public:
40   explicit SystemError(std::string what);
41   virtual ~SystemError() throw();
42   virtual const char* what() const throw() override;
43 
44  private:
45   std::string description;
46 };
47 
48 #endif  // SRC_SYSTEMS_BASE_SYSTEM_ERROR_H_
49