updated error message names
This commit is contained in:
parent
9b0f60d30f
commit
fe0b84f470
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user