• The_Decryptor@aussie.zone
    link
    fedilink
    English
    arrow-up
    2
    ·
    17 hours ago

    Yep, their frontend used a shared caller that would return the parsed JSON response if the request was successful, and error otherwise. And then the code that called it would use the returned object directly.

    So I assume that most of the backend did actually surface error codes via the HTTP layer, it was just this one endpoint that didn’t (Which then broke the client side code when it tried to access non-existent properties of the response object), because otherwise basic testing would have caught it.

    That’s also another reason to use the HTTP codes, by storing the error in the response body you now need extra code between the function doing the API call and the function handling a successful result, to examine the body to see if there was actually an error, all based on an ad-hoc per-endpoint format.

    • luciferofastora@feddit.org
      link
      fedilink
      arrow-up
      1
      ·
      12 hours ago

      So I assume that most of the backend did actually surface error codes via the HTTP layer, it was just this one endpoint that didn’t

      How is this getting even worse still? Why would a single endpoint work differently? That suggests they have standards, just one arsehole decided to shit on it and the rest didn’t vet their code enough to catch the issue.

      otherwise basic testing would have caught it

      I worked QA in a small dev team for two years. You might be surprised how uncomfortable you can make some developers within five minutes of “basic testing”. By the time I left, the team lead loved me as much as some of the devs must have hated me.