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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user