-
Notifications
You must be signed in to change notification settings - Fork 74
v0.2.55..v0.2.56 changeset ElementMergeServer.js
Garret Voltz edited this page Aug 14, 2020
·
3 revisions
diff --git a/translations/ElementMergeServer.js b/translations/ElementMergeServer.js
index 1c22ada..9bd1262 100644
--- a/translations/ElementMergeServer.js
+++ b/translations/ElementMergeServer.js
@@ -80,7 +80,14 @@ function ElementMergeserver(request, response) {
request.on('end', function() {
- var result = postHandler(payload);
+ var result;
+ try {
+ result = postHandler(payload);
+ } catch (err) {
+ var status = 400;
+ response.writeHead(status, header);
+ response.end(JSON.stringify({error: err}));
+ }
response.writeHead(200, header);
response.end(result);