2 * Copyright (c) 2022 Francis Deslauriers <francis.deslauriers@efficios.com>
4 * SPDX-License-Identifier: MIT
7 #ifndef BABELTRACE_CPP_COMMON_EXC_HPP
8 #define BABELTRACE_CPP_COMMON_EXC_HPP
15 namespace bt2_common {
20 class End : public std::exception
23 explicit End() noexcept : std::exception {}
31 class Error : public std::runtime_error
34 explicit Error(std::string msg = "Error") : std::runtime_error {std::move(msg)}
42 class OverflowError : public Error
45 explicit OverflowError() noexcept : Error {"Overflow error"}
53 class MemoryError : public std::bad_alloc
56 explicit MemoryError() noexcept : std::bad_alloc {}
62 * Not available right now: try again later.
64 class TryAgain : public std::exception
67 explicit TryAgain() noexcept : std::exception {}
72 } /* namespace bt2_common */
74 #endif /* BABELTRACE_CPP_COMMON_EXC_HPP */