public errordomain ErrType01 { ERROR_CODE_01 } public errordomain ErrType02 { ERROR_TYPE_02 } public class MyClass : GLib.Object { public static void myfunc_throw() throws ErrType01, ErrType02 { throw new ErrType01.ERROR_CODE_01( "Ошибка с кодом 01" ); // throw new ErrType02.ERROR_TYPE_02( "Ошибка с типом 02" ); } public static void myfunc_catch() throws ErrType02 { try { myfunc_throw(); } catch( ErrType01 e ) { // Здесь обрабатываются ошибки из домена ErrType01 stdout.printf ("ERR: %s\n", e.message); } finally { // Освобождение ресурсов и прочие необходимые операции stdout.printf ("Освобождение ресурсов и прочие необходимые операции.\n"); } } public static int main( string[] args ) { try { myfunc_catch(); } catch( ErrType02 e ) { // Здесь обрабатываются ошибки из домена ErrType02 stdout.printf ("ERR: %s\n", e.message); } return 0; } }