diff --git a/src/SASjs.ts b/src/SASjs.ts index b47da33..53c1202 100644 --- a/src/SASjs.ts +++ b/src/SASjs.ts @@ -1107,9 +1107,19 @@ 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)) + 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 { diff --git a/src/types/ErrorResponse.ts b/src/types/ErrorResponse.ts index 67400e0..0057f3a 100644 --- a/src/types/ErrorResponse.ts +++ b/src/types/ErrorResponse.ts @@ -3,7 +3,7 @@ export class ErrorResponse { constructor(message: string, details?: any, raw?: any) { let detailsString = details - + if (typeof details !== 'object') { try { detailsString = JSON.parse(details)