Can we get whole list of domains we might get in GError?

As we know, some APIs in Gtk takes GError as out parameter for error handling purpose. GError contains three values (domain, code, and message).

I want to know what possible domain values I might get in GError, so that I can effectively handle those set of errors. Can we have full list of domains and error codes in that domain(s).

I found a few examples of domain and error-codes for that domain (e.g. FileError, IOError) but want to know if we can get the full list?

Thanks.

Not programmatically. The documentation should make it clear, but if an API is just propagating errors from a lower layer, you may get anything.

1 Like

Can you point me to the documentation which contains list of domains (used in gtk) if possible?

There’s the list of error domains registered by GTK, and every function that throws a GError should list what kind of error domains should be expected.

Thanks @ebassi . That helped.