doc: change exception handler lambda to take two parameters

This commit is contained in:
2024-11-10 12:22:13 +00:00
parent 546d5db4e2
commit f1e797e6ba

View File

@@ -304,9 +304,9 @@ a = (32, 64).
try try
v = Int parse:'342' v = Int parse:'342'
catch (#err:number_format, err) in catch (#err:number_format, err) in
cout put:'Cannot parse integer string ({err msg})' cout put:'Cannot parse integer string ({err})'
catch (_, err) in catch (_, err) in
cout put:'Unknown error occurred ({err msg})' cout put:'Unknown error occurred ({err})'
end end
/* equivalent 'pure' syntax */ /* equivalent 'pure' syntax */
@@ -335,11 +335,11 @@ end
**/ **/
[ v = Int parse:'342' ] [ v = Int parse:'342' ]
on:#err:number_format do:[ :err | on:#err:number_format do:[ :err :data |
cout put:'Cannot parse integer string ({err msg})' cout put:'Cannot parse integer string ({err})'
]; ];
onError:[ :err | onError:[ :err :data |
cout put:'Unknown error occurred ({err msg})' cout put:'Error {err} occurred ({data})'
]; ];
call. call.