25 #ifndef SVNXX_EXCEPTION_HPP 26 #define SVNXX_EXCEPTION_HPP 85 namespace subversion {
96 virtual const char* what()
const noexcept
override 111 using error_ptr = std::shared_ptr<svn_error_t>;
117 class error :
public std::exception,
118 protected detail::error_ptr
130 virtual const char* what()
const noexcept
override;
136 virtual int code()
const noexcept;
143 virtual const char* name()
const noexcept;
154 int code() const noexcept {
return m_errno; }
160 const char*
name() const noexcept {
return m_errname; }
165 const std::string&
text() const noexcept {
return m_message; }
170 std::string generic_text()
const;
175 bool trace() const noexcept {
return m_trace; }
178 message(
int errval,
const char* errname,
179 const std::string& message_,
bool trace)
188 const char* m_errname;
189 std::string m_message;
199 return compile_messages(
false);
211 return compile_messages(
true);
215 error(detail::error_ptr err);
216 const char*
const m_message;
217 std::vector<message> compile_messages(
bool show_traces)
const;
244 virtual const char* what()
const noexcept
override;
254 #endif // SVNXX_EXCEPTION_HPP int code() const noexcept
Return the error code.
Exception type that will be thrown when memory allocation fails.
Subversion's data types (common implementation)
virtual std::vector< message > traced_messages() const
Like error::messages(), but includes debugging traceback.
Thrown instead of Error when the error chain contains a SVN_ERR_CANCELLED error code.
Encapsulate a stack of Subversion error codes and messages.
Error message description.
const char * name() const noexcept
Return the error name.
User code should throw this exception from callbacks to cancel an operation.
const std::string & text() const noexcept
Return the error message.
bool trace() const noexcept
Check if this message is in fact a debugging traceback entry.
virtual std::vector< message > messages() const
Returns the complete list of error messages, including those from nested errors.