Exceptions: Difference between revisions
Content added Content deleted
(→Throw exceptions: how to get debug information in exceptions) |
|||
Line 735: | Line 735: | ||
<lang oz>raise sillyError end |
<lang oz>raise sillyError end |
||
raise slightlyLessSilly(data:42 reason:outOfMemory) end</lang> |
raise slightlyLessSilly(data:42 reason:outOfMemory) end</lang> |
||
By using a record value with a feature <code>debug</code> set to <code>unit</code> you can indicate that the exception shall have debug information (including a stack trace). |
|||
<lang oz>try |
|||
raise someError(debug:unit) end |
|||
catch someError(debug:d(stack:ST ...)...) then |
|||
{Inspect ST} |
|||
end</lang> |
|||
See also: [http://www.mozart-oz.org/documentation/base/exception.html Exceptions] in the Oz documentation. |
|||
===Catching exceptions=== |
===Catching exceptions=== |