quic/qbox
Loading...
Searching...
No Matches
exceptions.h
1/*
2 * This file is part of libqemu-cxx
3 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
4 * Author: GreenSocs 2015-2019
5 *
6 * SPDX-License-Identifier: BSD-3-Clause
7 */
8
9#pragma once
10
11#include <stdexcept>
12
13#include <libqemu-cxx/target_info.h>
14
15namespace qemu {
16
17class LibQemuException : public std::runtime_error
18{
19public:
20 LibQemuException(const char* what): std::runtime_error(what) {}
21 LibQemuException(const std::string& what): std::runtime_error(what) {}
22
23 virtual ~LibQemuException() throw() {}
24};
25
27{
28public:
30 : LibQemuException(std::string("target `") + get_target_name(t) + "` disabled at compile time.")
31 {
32 }
33
34 virtual ~TargetNotSupportedException() throw() {}
35};
36
38{
39public:
40 LibraryLoadErrorException(const char* lib_name, const char* error)
41 : LibQemuException(std::string("error while loading libqemu library `") + lib_name + "`: " + error)
42 {
43 }
44
45 virtual ~LibraryLoadErrorException() throw() {}
46};
47
49{
50public:
51 InvalidLibraryException(const char* lib_name, const char* symbol)
52 : LibQemuException(std::string("Invalid libqemu library `") + lib_name + "` " + "(Symbol `" + symbol +
53 "` not found).")
54 {
55 }
56
57 virtual ~InvalidLibraryException() throw() {}
58};
59
61{
62public:
63 SetPropertyException(const char* type, const char* name, const char* err)
64 : LibQemuException(std::string("Error while setting ") + type + " property `" + name + "` on object: " + err)
65 {
66 }
67
68 virtual ~SetPropertyException() throw() {}
69};
70
72{
73public:
74 GetPropertyException(const char* type, const char* name, const char* err)
75 : LibQemuException(std::string("Error while getting ") + type + " property `" + name + "` on object: " + err)
76 {
77 }
78
79 virtual ~GetPropertyException() throw() {}
80};
81
82} // namespace qemu
Definition target.h:160
Definition exceptions.h:72
Definition exceptions.h:49
Definition exceptions.h:18
Definition exceptions.h:38
Definition exceptions.h:61
Definition exceptions.h:27