glib2: create code level error classes and use them rather than domain error