To set a GErrors, I need to pass a domain and a code:
g_set_error(error,
G_FILE_ERROR,
G_FILE_ERROR_NOENT,
"error message");
I want to pass my own domain and code, such as:
g_set_error(error,
MY_ERROR_DOMAIN,
MY_ERROR_DOMAIN_CODE,
"error message");
I’ve read the Error Reporting page and a blog post about GErrors. I’m still unclear on what do I need to do to achieve what I want. Do I need to extend GError
type in this case, for example, create a GMyError
type?