Anonymous user
Exceptions: Difference between revisions
m
→{{header|Elena}}
Line 973:
'''Defining exceptions'''
<lang elena>class MyException
{
constructor new()
<= new:"MyException raised"
}</lang>
'''Throw exceptions'''
<lang elena>foo()
{
MyException
}
</lang>
'''Catching exceptions'''
<lang elena>try
{
}
catch(MyException e)
// handle exceptions of type MyException and derived▼
{
}</lang>
'''Catching any exception'''
<lang elena>o
{
// handle any type of exception not handled by above catches
=={{header|Erlang}}==
|