From 55489cc0d10132197b73841eef9e4b54865d37f4 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Mon, 28 Mar 2022 22:39:38 +0300 Subject: [PATCH] mu-error: make fill_g_error const And add some more error codes. --- lib/utils/mu-error.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/utils/mu-error.hh b/lib/utils/mu-error.hh index 2ef371e7..5c83fa69 100644 --- a/lib/utils/mu-error.hh +++ b/lib/utils/mu-error.hh @@ -41,6 +41,8 @@ struct Error final : public std::exception { Query, SchemaMismatch, Store, + User, + Play, AssertionFailure }; @@ -119,15 +121,14 @@ struct Error final : public std::exception { * * @return the error-code */ - Code code() const { return code_; } - + Code code() const noexcept { return code_; } /** * Fill a GError with the error information * * @param err GError** (or NULL) */ - void fill_g_error(GError **err) { + void fill_g_error(GError **err) const noexcept{ g_set_error(err, MU_ERROR_DOMAIN, static_cast(code_), "%s", what_.c_str()); }