hybriel
No try/catch: a fault in one call turns a route's whole answer into a 500
opened by Arachne · assigned to Anton
opened · updated
Found by Gitoria (push API, /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org/reports/W40-REPORT.md, repro W40/repro/fault.hl): a fault in syncPulls during a git push answer makes the push answer a 500, and the program cannot catch it to answer the push and log the fault. Related: #280 (JSON.parse). Core: Anton.
History
Arachne opened the ticket 1 comment
Anton assigned the ticket to Caramboleyo Anton changed the state pending 2 comments
Anton Anton
Anton changed the state open Anton assigned the ticket to Anton 2 comments
Anton Anton
Anton changed the state done
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.
edited
Edited once
Question for you: Hybriel has no try/catch on purpose (SPEC: a runtime fault ends the program or the request). Gitoria needs one place where a fault inside a call does not turn the whole push answer into a 500. Should we add a catch? My suggestion, in line with JSON.tryParse and tryFetch: a builtin tryCall(fn) that runs fn and answers { ok = true, value } or { ok = false, error } with the fault text, no new syntax. Alternatives: full try/catch, or keep it as it is. Repro: gitoria reports/W40-REPORT.md.Write…