From 89195d3449d8fa895ea71d49a7d25f20cb1e5928 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 1 Jan 2021 19:08:36 -0800 Subject: [PATCH] Add comment about response catching strictness levels. --- frontends/etiquette_flask/static/js/common.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontends/etiquette_flask/static/js/common.js b/frontends/etiquette_flask/static/js/common.js index 051ef95..2c39edd 100644 --- a/frontends/etiquette_flask/static/js/common.js +++ b/frontends/etiquette_flask/static/js/common.js @@ -76,6 +76,12 @@ function _request(method, url, callback) } "data": {JSON parsed from server response if json_ok}. } + + So, from most lenient to most strict, error catching might look like: + if response.meta.completed + if response.meta.json_ok + if response.meta.status === 200 + if response.meta.status === 200 and response.meta.json_ok */ const request = new XMLHttpRequest(); const response = {