Jump to content

Exceptions: Difference between revisions

→‎Throw exceptions: how to get debug information in exceptions
(→‎Throw exceptions: how to get debug information in exceptions)
Line 735:
<lang oz>raise sillyError end
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===
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.