From fe0b84f470f300f2ce097a4fc65512996e51871c Mon Sep 17 00:00:00 2001 From: William Mantly Date: Fri, 20 Dec 2019 20:41:49 -0500 Subject: [PATCH] updated error message names --- nodejs/models/hosts.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nodejs/models/hosts.js b/nodejs/models/hosts.js index 365003e..0f95fac 100755 --- a/nodejs/models/hosts.js +++ b/nodejs/models/hosts.js @@ -29,6 +29,7 @@ async function getInfo(data){ } let error = new Error('HostNotFound'); + error.name = 'HostNotFound'; error.message = 'Host does not exists'; error.status = 404; throw error; @@ -68,6 +69,7 @@ async function add(data, edit){ if(data.host && await exists(data.host)){ let error = new Error('HostNameUsed'); + error.name = 'HostNameUsed'; error.message = 'Host already exists'; error.status = 409; throw error;