Currently, our handling of failed AJAX request responses is all over the place: sometimes we fail silently and log to console; sometimes we create a notification with the HTTP status code; sometimes we rely on the message the server sends in the response payload.
Even when we do rely on the message field, oftentimes the server does not actually send one. Oh, and also sometimes we rely on the error field instead.
This issue is to track our efforts for streamlining our handling of failed AJAX requests:
I've already added a centralized handleJSONResponse API for error handling, we just need to connect it & align server responses with it.
Currently, our handling of failed AJAX request responses is all over the place: sometimes we fail silently and log to console; sometimes we create a notification with the HTTP status code; sometimes we rely on the
messagethe server sends in the response payload.Even when we do rely on the
messagefield, oftentimes the server does not actually send one. Oh, and also sometimes we rely on theerrorfield instead.This issue is to track our efforts for streamlining our handling of failed AJAX requests:
message);message);message);errorOR hardcoded + bare HTTP status code);message);message);message+ bare HTTP status code);I've already added a centralized
handleJSONResponseAPI for error handling, we just need to connect it & align server responses with it.