doc: add try-catch-finally example file

This commit is contained in:
2025-01-16 13:17:46 +00:00
parent 46d244a28d
commit 5017e2e736

12
doc/sample/Exception.im Normal file
View File

@@ -0,0 +1,12 @@
try
x = 0
--v = Int parse:'342'
catch (#err:number_format, err) in
x = 1
--cout put:'Cannot parse integer string ({err})'
catch (_, err) in
x = 2
--cout put:'Unknown error occurred ({err})'
finally
x = 3
end