mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-05 11:40:06 +00:00
feat: service not found error handling for SAS9
This commit is contained in:
@@ -1107,6 +1107,11 @@ export default class SASjs {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.updateUsername(responseText)
|
this.updateUsername(responseText)
|
||||||
|
if (responseText.includes('The requested URL /SASStoredProcess/do/ was not found on this server.') ||
|
||||||
|
responseText.includes('Stored process not found')) {
|
||||||
|
reject(new ErrorResponse('Service not found on the server', {service: sasJob}, responseText))
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const parsedJson = JSON.parse(responseText)
|
const parsedJson = JSON.parse(responseText)
|
||||||
resolve(parsedJson)
|
resolve(parsedJson)
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
export class ErrorResponse {
|
export class ErrorResponse {
|
||||||
error: ErrorBody
|
error: ErrorBody
|
||||||
|
|
||||||
constructor(message: string, details?: any) {
|
constructor(message: string, details?: any, raw?: any) {
|
||||||
let detailsString = ''
|
let detailsString = details
|
||||||
let raw
|
|
||||||
|
if (typeof details !== 'object') {
|
||||||
try {
|
try {
|
||||||
detailsString = JSON.stringify(details)
|
detailsString = JSON.parse(details)
|
||||||
} catch {
|
} catch {
|
||||||
raw = details
|
raw = details
|
||||||
|
detailsString = ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.error = {
|
this.error = {
|
||||||
|
|||||||
Reference in New Issue
Block a user