UserForm: ajout retour de validation d'API

This commit is contained in:
2020-03-09 11:32:21 +01:00
parent de6832e94f
commit 67732aa00a
11 changed files with 163 additions and 19 deletions

View File

@ -0,0 +1,21 @@
export class APIError extends Error {
constructor(endpoint, code, message, data) {
super(`APIError: ${message}`);
this.endpoint = endpoint;
this.code = code;
this.data = data;
Error.captureStackTrace(this, APIError);
}
getEndpoint() {
return this.endpoint;
}
getCode() {
return this.code;
}
getData() {
return this.data;
}
}