updated error message names

This commit is contained in:
William Mantly 2019-12-20 20:41:49 -05:00
parent 9b0f60d30f
commit fe0b84f470
Signed by: wmantly
GPG Key ID: E1EEC7650BA97160

View File

@ -29,6 +29,7 @@ async function getInfo(data){
} }
let error = new Error('HostNotFound'); let error = new Error('HostNotFound');
error.name = 'HostNotFound';
error.message = 'Host does not exists'; error.message = 'Host does not exists';
error.status = 404; error.status = 404;
throw error; throw error;
@ -68,6 +69,7 @@ async function add(data, edit){
if(data.host && await exists(data.host)){ if(data.host && await exists(data.host)){
let error = new Error('HostNameUsed'); let error = new Error('HostNameUsed');
error.name = 'HostNameUsed';
error.message = 'Host already exists'; error.message = 'Host already exists';
error.status = 409; error.status = 409;
throw error; throw error;