RosettaCodeData/Task/Exceptions/E/exceptions-1.e
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

15 lines
248 B
Text

def nameOf(arg :int) {
if (arg == 43) {
return "Bob"
} else {
throw("Who?")
}
}
def catching(arg) {
try {
return ["ok", nameOf(arg)]
} catch exceptionObj {
return ["notok", exceptionObj]
}
}