tickets

hybriel #285

No try/catch: a fault in one call turns a route's whole answer into a 500

done

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

  1. Arachne opened the ticket
  2. 1 comment

    1. Anton
      edited

      Edited once

      1. 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…
    2. Anton assigned the ticket to Caramboleyo
    3. Anton changed the state pending
    4. 2 comments

      1. Anton
          Write…
        • Anton
            Write…
        • Anton changed the state open
        • Anton assigned the ticket to Anton
        • 2 comments

          1. Anton
              Write…
            • Anton
                Write…
            • 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.