
Python frames in mixed stack traces were missing file name and pointed to a line below correct position Change-Id: I335292f40b3b6ea3dbca80b84f1d8dbed9a6581d Fixes: bug #1331113
56 lines
1.1 KiB
YAML
56 lines
1.1 KiB
YAML
Name: ExceptionHandling
|
|
|
|
Methods:
|
|
testThrow:
|
|
Arguments:
|
|
- enum:
|
|
Contract: $.int().notNull()
|
|
Body:
|
|
Try:
|
|
- trace('enter try')
|
|
- $.doThrow($enum)
|
|
- trace('exit try')
|
|
Catch:
|
|
- With: exceptionName
|
|
As: e
|
|
Do:
|
|
- trace($e.message)
|
|
- With: anotherExceptionName
|
|
As: e
|
|
Do:
|
|
- trace($e.message)
|
|
- trace(rethrow)
|
|
- Rethrow:
|
|
- As: e
|
|
Do:
|
|
- trace('catch all')
|
|
- trace($e.message)
|
|
Else:
|
|
- trace('else section')
|
|
Finally:
|
|
- trace('finally section')
|
|
|
|
doThrow:
|
|
Arguments:
|
|
- enum:
|
|
Contract: $.int().notNull()
|
|
Body:
|
|
- Match:
|
|
1:
|
|
- Throw: exceptionName
|
|
Message: exception message
|
|
2:
|
|
- Throw: anotherExceptionName
|
|
Message: exception message 2
|
|
3:
|
|
- Throw: thirdExceptionName
|
|
Message: exception message 3
|
|
4:
|
|
- Return:
|
|
Value: $enum
|
|
|
|
testStackTrace:
|
|
Body:
|
|
raisePythonException()
|
|
|