-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceptions.h
More file actions
38 lines (36 loc) · 1.6 KB
/
exceptions.h
File metadata and controls
38 lines (36 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* Auto-added header
* File: exceptions.h
* Author: camradeling
* Email: camradeling@gmail.com
* 2025
*/
//------------------------------------------------------------------------------------------------------------------------------
#ifndef ELFMAN_EXCEPTIONS_H
#define ELFMAN_EXCEPTIONS_H
//------------------------------------------------------------------------------------------------------------------------------
#include <string>
#include <stdexcept>
//------------------------------------------------------------------------------------------------------------------------------
class exception_base : public std::runtime_error {
public:
exception_base()
: std::runtime_error(std::string()) { }
exception_base(const std::string& message)
: std::runtime_error(message) { }
exception_base(const char* message)
: std::runtime_error(message) { }
};
//------------------------------------------------------------------------------------------------------------------------------
class malformed_object : public exception_base {
public:
malformed_object() : exception_base("Malformed object") { }
malformed_object(const std::string& message) : exception_base(message) { }
};
//------------------------------------------------------------------------------------------------------------------------------
class serialization_error : public exception_base {
public:
serialization_error() : exception_base("Serialization error") { }
};
//------------------------------------------------------------------------------------------------------------------------------
#endif/*ELFMAN_EXCEPTIONS_H*/