1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

fixing ErrorDTO during request saving

This commit is contained in:
Patrik J. Braun 2020-12-27 22:32:26 +01:00
parent b37d4ec8c8
commit fb39fb5854

View File

@ -33,11 +33,13 @@ export class ErrorDTO {
constructor(public code: ErrorCodes, public message?: string, public details?: any, req?: Request) {
this.detailsStr = (this.details ? this.details.toString() : '') || ErrorCodes[code];
if (req) {
this.request = {
method: req.method,
url: req.url
};
}
}
toString(): string {
return '[' + ErrorCodes[this.code] + '] ' + this.message + this.detailsStr;