DNS API error message

This commit is contained in:
2024-08-11 12:24:42 -04:00
parent 3e989992df
commit cb87f22d98
6 changed files with 100 additions and 108 deletions
+25
View File
@@ -0,0 +1,25 @@
'use strict';
let dnsErrors = {
unauthorized(instance){
let error = new Error('UnauthorizedDnsApi');
error.name = 'UnauthorizedDnsApi';
error.message = `Unauthorized call to ${instance.constructor ? instance.constructor.name : instance.name}`;
error.status = 424;
return error;
},
other(instance, status, message){
let error = new Error('OtherDnsApiError');
error.name = 'OtherDnsApiError';
error.message = `DNS API Error ${instance.constructor ? instance.constructor.name : instance.name}: `;
error.status = 424;
return error;
},
}
module.exports = {
dnsErrors
};