Sending correct error response status
Change-Id: Iacacea87405094efdeb391684d1f6fed969531a4
diff --git a/README.md b/README.md
index cc4b083..0f19768 100644
--- a/README.md
+++ b/README.md
@@ -57,4 +57,19 @@
To start the client: `cd spec; browser-sync start --server`
+### Send a fake REDIS event
+
+```
+redis-cli -h xos.dev
+
+# In progress
+PUBLISH Slice "{\"pk\": 19, \"object\": {\"id\": 19,\"name\": \"mysite_test_redis\", \"backend_status\": \"0 - In Progress\"}, \"changed_fields\": [\"updated\", \"backend_status\"]}"
+
+# Succes
+PUBLISH Slice "{\"pk\": 19, \"object\": {\"id\": 19,\"name\": \"mysite_test_redis\", \"backend_status\": \"1 - Success\"}, \"changed_fields\": [\"updated\", \"backend_status\"]}"
+
+# Error
+PUBLISH Slice "{\"pk\": 19, \"object\": {\"id\": 19,\"name\": \"mysite_test_redis\", \"backend_status\": \"2 - Error\"}, \"changed_fields\": [\"updated\", \"backend_status\"]}"
+```
+
diff --git a/src/routes/core_proxy.js b/src/routes/core_proxy.js
index 6da2eef..e9cc408 100644
--- a/src/routes/core_proxy.js
+++ b/src/routes/core_proxy.js
@@ -39,7 +39,7 @@
.end((err, r) => {
if(err) {
logger.log('error', err);
- return res.status(500).send(err);
+ return res.status(err.status).send(err.response.error);
}
logger.log('debug', r.status, r.body);
return res.status(r.status).type('json').send(r.body);