mu-error: make fill_g_error const
And add some more error codes.
This commit is contained in:
@ -41,6 +41,8 @@ struct Error final : public std::exception {
|
|||||||
Query,
|
Query,
|
||||||
SchemaMismatch,
|
SchemaMismatch,
|
||||||
Store,
|
Store,
|
||||||
|
User,
|
||||||
|
Play,
|
||||||
AssertionFailure
|
AssertionFailure
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -119,15 +121,14 @@ struct Error final : public std::exception {
|
|||||||
*
|
*
|
||||||
* @return the error-code
|
* @return the error-code
|
||||||
*/
|
*/
|
||||||
Code code() const { return code_; }
|
Code code() const noexcept { return code_; }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fill a GError with the error information
|
* Fill a GError with the error information
|
||||||
*
|
*
|
||||||
* @param err GError** (or NULL)
|
* @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<int>(code_),
|
g_set_error(err, MU_ERROR_DOMAIN, static_cast<int>(code_),
|
||||||
"%s", what_.c_str());
|
"%s", what_.c_str());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user