From 3b3a135fc66ade0463626f72e769092a54cb0740 Mon Sep 17 00:00:00 2001 From: AllenIverson <31821408+466919153@users.noreply.github.com> Date: Mon, 23 Apr 2018 21:05:40 +0800 Subject: [PATCH] Update exception.hpp add exception code --- include/fc/exception/exception.hpp | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/include/fc/exception/exception.hpp b/include/fc/exception/exception.hpp index d907f7221..5f8724b37 100644 --- a/include/fc/exception/exception.hpp +++ b/include/fc/exception/exception.hpp @@ -6,11 +6,39 @@ #include #include #include - +#include +#include +#include namespace fc { namespace detail { class exception_impl; } + enum exception_code + { + /** for exceptions we threw that don't have an assigned code */ + unspecified_exception_code = 0, + unhandled_exception_code = 1, ///< for unhandled 3rd party exceptions +\ + timeout_exception_code = 2, ///< timeout exceptions + file_not_found_exception_code = 3, + parse_error_exception_code = 4, + invalid_arg_exception_code = 5, + key_not_found_exception_code = 6, + bad_cast_exception_code = 7, + out_of_range_exception_code = 8, + canceled_exception_code = 9, + assert_exception_code = 10, + eof_exception_code = 11, + std_exception_code = 13, + invalid_operation_exception_code = 14, + unknown_host_exception_code = 15, + null_optional_code = 16, + udt_error_code = 17, + aes_error_code = 18, + overflow_code = 19, + underflow_code = 20, + divide_by_zero_code = 21 + }; /** * @brief Used to generate a useful error report when an exception is thrown. * @ingroup serializable