77 {
return typeid(*this).name(); }
81 virtual std::ostream &
print(std::ostream &os)
const 82 {
return os <<
"general exception"; }
105 inline std::ostream &
107 {
return ge.
print(os); }
120 m_mesg(
std::move(mesg))
123 std::ostream &
print(std::ostream &os)
const override 124 {
return os <<
"unknown command: `" << m_mesg <<
"`"; }
130 #define unknown_command(a) bfn::unknown_command_error(a) 140 m_mesg(
std::move(mesg))
143 std::ostream &
print(std::ostream &os)
const override 144 {
return os <<
"unknown vmcall type: `" << m_mesg <<
"`"; }
150 #define unknown_vmcall_type(a) bfn::unknown_vmcall_type_error(a) 160 m_mesg(
std::move(mesg))
163 std::ostream &
print(std::ostream &os)
const override 164 {
return os <<
"unknown string type: `" << m_mesg <<
"`"; }
170 #define unknown_vmcall_string_type(a) bfn::unknown_vmcall_string_type_error(a) 180 m_mesg(
std::move(mesg))
183 std::ostream &
print(std::ostream &os)
const override 184 {
return os <<
"unknown data type: `" << m_mesg <<
"`"; }
190 #define unknown_vmcall_data_type(a) bfn::unknown_vmcall_data_type_error(a) 199 std::ostream &
print(std::ostream &os)
const override 200 {
return os <<
"missing argument"; }
203 #define missing_argument() bfn::missing_argument_error() 213 m_mesg(
std::move(mesg))
216 std::ostream &
print(std::ostream &os)
const override 217 {
return os <<
"invalid filename: `" << m_mesg <<
"`"; }
223 #define invalid_file(a) bfn::invalid_file_error(a) 232 std::ostream &
print(std::ostream &os)
const override 234 os <<
"bareflank driver inaccessible:";
235 os << std::endl <<
" - check that the bareflank driver is loaded";
236 os << std::endl <<
" - check that bfm was exectued with the " 237 <<
"proper permissions";
242 #define driver_inaccessible(a) bfn::driver_inaccessible_error(a) 252 m_ioctl(
std::move(ioctl))
255 std::ostream &
print(std::ostream &os)
const override 256 {
return os <<
"ioctl failed: `" << m_ioctl <<
"`"; }
262 #define ioctl_failed(a) bfn::ioctl_failed_error(#a) 271 std::ostream &
print(std::ostream &os)
const override 272 {
return os <<
"unable to process request. vmm is in a corrupt state"; }
275 #define corrupt_vmm() bfn::corrupt_vmm_error() 284 std::ostream &
print(std::ostream &os)
const override 285 {
return os <<
"unable to process request. vmm status unknown"; }
288 #define unknown_status() bfn::unknown_status_error() 298 m_mesg(
std::move(mesg))
301 std::ostream &
print(std::ostream &os)
const override 302 {
return os << m_mesg; }
308 #define invalid_vmm_state(a) bfn::invalid_vmm_state_error(a)
~general_exception() override=default
std::ostream & print(std::ostream &os) const override
virtual std::ostream & print(std::ostream &os) const
invalid_file_error(std::string mesg)
std::ostream & print(std::ostream &os) const override
std::ostream & print(std::ostream &os) const override
unknown_command_error(std::string mesg)
unknown_vmcall_type_error(std::string mesg)
unknown_vmcall_string_type_error(std::string mesg)
void uint64_t uint64_t uint64_t *rdx noexcept
ioctl_failed_error(std::string ioctl)
unknown_vmcall_data_type_error(std::string mesg)
std::ostream & operator<<(std::ostream &os, const bfn::general_exception &ge)
std::ostream & print(std::ostream &os) const override
std::ostream & print(std::ostream &os) const override
constexpr const auto string
std::ostream & print(std::ostream &os) const override
const char * what() const noexcept override
std::ostream & print(std::ostream &os) const override
std::ostream & print(std::ostream &os) const override
invalid_vmm_state_error(std::string mesg)
std::ostream & print(std::ostream &os) const override
general_exception() noexcept=default
std::ostream & print(std::ostream &os) const override
std::ostream & print(std::ostream &os) const override