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:
parent
b37d4ec8c8
commit
fb39fb5854
@ -33,10 +33,12 @@ export class ErrorDTO {
|
|||||||
|
|
||||||
constructor(public code: ErrorCodes, public message?: string, public details?: any, req?: Request) {
|
constructor(public code: ErrorCodes, public message?: string, public details?: any, req?: Request) {
|
||||||
this.detailsStr = (this.details ? this.details.toString() : '') || ErrorCodes[code];
|
this.detailsStr = (this.details ? this.details.toString() : '') || ErrorCodes[code];
|
||||||
this.request = {
|
if (req) {
|
||||||
method: req.method,
|
this.request = {
|
||||||
url: req.url
|
method: req.method,
|
||||||
};
|
url: req.url
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toString(): string {
|
toString(): string {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user