Flyby SDK v1.0.2
Loading...
Searching...
No Matches
error.h
Go to the documentation of this file.
1
7
8#pragma once
9
10#include <exception>
11#include <stdexcept>
12#include <utility>
13
14namespace flyby {
19 class not_implemented_error final : public std::exception {
20 public:
25
31 const char* what() {
32 return "Function not implemented.";
33 }
34 };
35
40 class not_available_error final : public std::exception {
41 public:
46
52 const char* what() {
53 return "Operaiton not available.";
54 }
55 };
56
61 class parse_error final : public std::exception {
62 public:
66 parse_error() = default;
67
73 const char* what() {
74 return "Object cannot be parsed correctly.";
75 }
76 };
77
82 class invalid_operation_error final : public std::exception {
83 public:
88 : m_what_arg { "Invalid operation" } {}
89
93 explicit invalid_operation_error(std::string what_arg)
94 : m_what_arg { std::move(what_arg) } {}
95
101 const char* what() {
102 return m_what_arg.c_str();
103 }
104
105 private:
106 std::string m_what_arg;
107 };
108} // namespace flyby
const char * what()
Returns the error message.
Definition error.h:101
invalid_operation_error(std::string what_arg)
Reason constructor.
Definition error.h:93
invalid_operation_error()
Default constructor.
Definition error.h:87
const char * what()
Returns the error message.
Definition error.h:52
not_available_error()=default
Default constructor.
const char * what()
Returns the error message.
Definition error.h:31
not_implemented_error()=default
Default constructor.
parse_error()=default
Default constructor.
const char * what()
Returns the error message.
Definition error.h:73