The Battle for Wesnoth  1.15.0+dev
exception.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2018 by Mark de Wever <koraq@xs4all.nl>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #pragma once
16 
17 /**
18  * @file
19  * Contains a basic exception class for SDL operations.
20  */
21 
22 #include "exceptions.hpp"
23 
24 namespace sdl
25 {
26 
27 struct exception : public game::error
28 {
29  /**
30  * Constructor.
31  *
32  * @param operation The operation that has failed.
33  * @param use_sdl_error If set to @c true the @p operation is
34  * appended with the SDL error message. Else the
35  * @p operation is the error message for the
36  * exception.
37  */
38  exception(const std::string& operation, const bool use_sdl_error);
39 };
40 
41 
42 } // namespace sdl
exception(const std::string &operation, const bool use_sdl_error)
Constructor.
Definition: exception.cpp:32
Base class for all the errors encountered by the engine.
Definition: exceptions.hpp:29