mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-06 20:10:05 +00:00
fix: JES API error handling if job does not exist
This commit is contained in:
@@ -1001,9 +1001,21 @@ export class SASViyaApiClient {
|
||||
|
||||
if (allJobsInFolder) {
|
||||
const jobSpec = allJobsInFolder.find((j: Job) => j.name === jobName)
|
||||
|
||||
if (!jobSpec) {
|
||||
console.error('Job was not found.')
|
||||
throw new Error('Job was not found.')
|
||||
}
|
||||
|
||||
const jobDefinitionLink = jobSpec?.links.find(
|
||||
(l) => l.rel === 'getResource'
|
||||
)?.href
|
||||
|
||||
if (!jobDefinitionLink) {
|
||||
console.error('Job definition URI was not found.')
|
||||
throw new Error('Job definition URI was not found.')
|
||||
}
|
||||
|
||||
const requestInfo: any = {
|
||||
method: 'GET'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user