3 errordomain Maman
.BarError
{
8 class Maman
.Bar
: Object
{
9 public void foo () throws BarError
{
12 throw new BarError
.FOO (" 8");
14 stdout
.printf (" BAD");
17 public int bad () throws BarError
{
22 stdout
.printf (" BAD");
27 public void good () throws BarError
{
31 public void error_cast_check (GLib
.Error e
) {}
45 stdout
.printf (" BAD");
46 } catch (BarError e
) {
49 stdout
.printf ("%s", e
.message
);
54 stdout
.printf (" 10");
57 static void test_generic_catch () {
59 throw new BarError
.FOO ("error message");
64 assert_not_reached ();
67 static void test_try_without_error () {
70 assert_not_reached ();
74 public static int main () {
75 stdout
.printf ("Exception Test: 1");
80 stdout
.printf (" 11\n");
82 test_generic_catch ();