mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-05 03:30:05 +00:00
feat: service not found error handling for SAS9
This commit is contained in:
@@ -1107,6 +1107,11 @@ export default class SASjs {
|
||||
}
|
||||
} else {
|
||||
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 {
|
||||
const parsedJson = JSON.parse(responseText)
|
||||
resolve(parsedJson)
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
export class ErrorResponse {
|
||||
error: ErrorBody
|
||||
|
||||
constructor(message: string, details?: any) {
|
||||
let detailsString = ''
|
||||
let raw
|
||||
|
||||
try {
|
||||
detailsString = JSON.stringify(details)
|
||||
} catch {
|
||||
raw = details
|
||||
constructor(message: string, details?: any, raw?: any) {
|
||||
let detailsString = details
|
||||
|
||||
if (typeof details !== 'object') {
|
||||
try {
|
||||
detailsString = JSON.parse(details)
|
||||
} catch {
|
||||
raw = details
|
||||
detailsString = ''
|
||||
}
|
||||
}
|
||||
|
||||
this.error = {
|
||||
|
||||
Reference in New Issue
Block a user