mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-17 17:10:05 +00:00
chore(edit-context): add error handling for fetch
This commit is contained in:
@@ -302,7 +302,18 @@ export class SASViyaApiClient {
|
|||||||
{
|
{
|
||||||
headers
|
headers
|
||||||
}
|
}
|
||||||
)
|
).catch((e) => {
|
||||||
|
console.error(e)
|
||||||
|
|
||||||
|
if (e && e.status === 404) {
|
||||||
|
throw new Error(
|
||||||
|
`The context with ID ${contextId} was not found on this server.`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
throw new Error(
|
||||||
|
`An error occurred when fetching the context with ID ${contextId}`
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
// An If-Match header with the value of the last ETag for the context
|
// An If-Match header with the value of the last ETag for the context
|
||||||
// is required to be able to update it
|
// is required to be able to update it
|
||||||
|
|||||||
Reference in New Issue
Block a user