1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 01:14:36 +00:00

fix: error response stringify and added raw field

This commit is contained in:
Mihajlo Medjedovic
2020-09-15 13:18:26 +02:00
parent a0ad8b3f34
commit 8504ec6c4d

View File

@@ -2,14 +2,25 @@ export class ErrorResponse {
body: ErrorBody
constructor(message: string, details?: any) {
let detailsString = '';
let raw
try {
detailsString = JSON.stringify(details)
} catch {
raw = details
}
this.body = {
message,
details
details: detailsString,
raw
}
}
}
interface ErrorBody {
message: string
details: any
details: string,
raw: any
}