SHOW:
|
|
- or go back to the newest paste.
1 | - | class client { |
1 | + | Transport t; |
2 | - | transport t; |
2 | + | async Task start() { |
3 | - | async Task connect() { |
3 | + | try { await t.connect(); } |
4 | - | try { await t.connect(); } |
4 | + | catch (TestException) { } |
5 | - | catch (TestException) {} |
5 | + | |
6 | - | } |
6 | + | await start(); |
7 | ||
8 | class Transport { | |
9 | - | class transport { |
9 | + | async Task connect() { |
10 | - | async Task connect() { throw new TestException(); } |
10 | + | try { |
11 | blah(); // causes a TestException to be thrown | |
12 | } | |
13 | - | await (new client()).connect(); |
13 | + | catch (AnythingButTestException) { } |
14 | } |