summaryrefslogtreecommitdiff
path: root/tests/errors/catch-error-code.vala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errors/catch-error-code.vala')
-rw-r--r--tests/errors/catch-error-code.vala16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/errors/catch-error-code.vala b/tests/errors/catch-error-code.vala
new file mode 100644
index 000000000..10bfd9db3
--- /dev/null
+++ b/tests/errors/catch-error-code.vala
@@ -0,0 +1,16 @@
+errordomain FooError {
+ BAR,
+ FOO
+}
+
+void main () {
+ bool cond = false;
+ try {
+ if (cond)
+ throw new FooError.BAR ("bad");
+ throw new FooError.FOO ("worse");
+ } catch (FooError.FOO e) {
+ } catch (FooError e) {
+ assert_not_reached ();
+ }
+}