diff --git a/include/boost/url/error.hpp b/include/boost/url/error.hpp index bea23fed..d486cbf6 100644 --- a/include/boost/url/error.hpp +++ b/include/boost/url/error.hpp @@ -140,7 +140,11 @@ enum class error enum class condition { - parse_error = 1 + /** A fatal error in syntax was encountered + + This indicates that parsing cannot continue. + */ + fatal = 1 }; } // urls diff --git a/include/boost/url/impl/error.hpp b/include/boost/url/impl/error.hpp index 8790070c..fb8260ee 100644 --- a/include/boost/url/impl/error.hpp +++ b/include/boost/url/impl/error.hpp @@ -12,8 +12,6 @@ #include -#ifndef BOOST_URL_STANDALONE - namespace boost { namespace system { template<> @@ -29,23 +27,6 @@ struct is_error_condition_enum<::boost::urls::condition> } // system } // boost -#else - -namespace std { -template<> -struct is_error_code_enum<::boost::urls::error> -{ - static bool const value = true; -}; -template<> -struct is_error_condition_enum<::boost::urls::condition> -{ - static bool const value = true; -}; -} // std - -#endif - namespace boost { namespace urls { diff --git a/include/boost/url/impl/error.ipp b/include/boost/url/impl/error.ipp index f08c76e4..59eb5ab3 100644 --- a/include/boost/url/impl/error.ipp +++ b/include/boost/url/impl/error.ipp @@ -129,24 +129,10 @@ case error::illegal_reserved_char: return "illegal reserved char"; default: return {ev, *this}; -case error::no_match: -case error::syntax: -case error::invalid: - -case error::missing_scheme: -case error::bad_scheme_start_char: -case error::bad_scheme_char: -case error::bad_username_char: -case error::bad_userinfo_char: -case error::bad_port_char: -case error::port_overflow: -case error::missing_hostname: -case error::missing_port: - case error::bad_pct_encoding_digit: case error::incomplete_pct_encoding: case error::illegal_reserved_char: - return condition::parse_error; + return condition::fatal; } } }; @@ -156,6 +142,8 @@ case error::illegal_reserved_char: std::underlying_type::type>(e), cat}; } +//------------------------------------------------ + error_condition make_error_condition(condition c) { @@ -173,8 +161,8 @@ make_error_condition(condition c) switch(static_cast(cv)) { default: - case condition::parse_error: - return "parsing error"; + case condition::fatal: + return "fatal condition"; } } }; diff --git a/test/error.cpp b/test/error.cpp index 4c07d9c8..ec2ce061 100644 --- a/test/error.cpp +++ b/test/error.cpp @@ -48,23 +48,23 @@ public: void run() { - check(condition::parse_error, error::no_match); - check(condition::parse_error, error::syntax); - check(condition::parse_error, error::invalid); + check(error::no_match); + check(error::syntax); + check(error::invalid); - check(condition::parse_error, error::missing_scheme); - check(condition::parse_error, error::bad_scheme_start_char); - check(condition::parse_error, error::bad_scheme_char); - check(condition::parse_error, error::bad_username_char); - check(condition::parse_error, error::bad_userinfo_char); - check(condition::parse_error, error::bad_port_char); - check(condition::parse_error, error::port_overflow); - check(condition::parse_error, error::missing_hostname); - check(condition::parse_error, error::missing_port); + check(error::missing_scheme); + check(error::bad_scheme_start_char); + check(error::bad_scheme_char); + check(error::bad_username_char); + check(error::bad_userinfo_char); + check(error::bad_port_char); + check(error::port_overflow); + check(error::missing_hostname); + check(error::missing_port); - check(condition::parse_error, error::bad_pct_encoding_digit); - check(condition::parse_error, error::incomplete_pct_encoding); - check(condition::parse_error, error::illegal_reserved_char); + check(condition::fatal, error::bad_pct_encoding_digit); + check(condition::fatal, error::incomplete_pct_encoding); + check(condition::fatal, error::illegal_reserved_char); } };