File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#include < odr/exceptions.hpp>
22
33#include < odr/file.hpp>
4+ #include < odr/odr.hpp>
45
56namespace odr {
67
@@ -18,11 +19,19 @@ FileNotFound::FileNotFound(const std::string &path)
1819UnknownFileType::UnknownFileType () : std::runtime_error(" unknown file type" ) {}
1920
2021UnsupportedFileType::UnsupportedFileType (const FileType file_type)
21- : std::runtime_error(" unknown file type" ), file_type{file_type} {}
22+ : std::runtime_error(" unknown file type: " +
23+ file_type_to_string (file_type)),
24+ file_type{file_type} {}
2225
2326UnknownDecoderEngine::UnknownDecoderEngine ()
2427 : std::runtime_error(" unknown decoder engine" ) {}
2528
29+ UnsupportedDecoderEngine::UnsupportedDecoderEngine (
30+ const DecoderEngine decoder_engine)
31+ : std::runtime_error(" unsupported decoder engine: " +
32+ decoder_engine_to_string (decoder_engine)),
33+ decoder_engine{decoder_engine} {}
34+
2635FileReadError::FileReadError () : std::runtime_error(" file read error" ) {}
2736
2837FileWriteError::FileWriteError (const std::string &path)
Original file line number Diff line number Diff line change 44
55namespace odr {
66enum class FileType ;
7+ enum class DecoderEngine ;
78
89// / @brief Unsupported operation exception
910struct UnsupportedOperation final : public std::runtime_error {
@@ -34,6 +35,13 @@ struct UnknownDecoderEngine final : public std::runtime_error {
3435 UnknownDecoderEngine ();
3536};
3637
38+ // / @brief Unsupported decoder engine exception
39+ struct UnsupportedDecoderEngine final : public std::runtime_error {
40+ DecoderEngine decoder_engine;
41+
42+ explicit UnsupportedDecoderEngine (DecoderEngine decoder_engine);
43+ };
44+
3745// / @brief File read error
3846struct FileReadError final : public std::runtime_error {
3947 FileReadError ();
You can’t perform that action at this time.
0 commit comments