feat(plugins/pagerduty): handle 404 error code in Api Client
* raise NotFoundError Signed-off-by: Alec Jacobs <cajacobs5401@gmail.com>
This commit is contained in:
@@ -164,6 +164,11 @@ export class PagerDutyClient implements PagerDutyApi {
|
||||
if (response.status === 401) {
|
||||
throw new UnauthorizedError();
|
||||
}
|
||||
|
||||
if (response.status === 404) {
|
||||
throw new NotFoundError();
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
const payload = await response.json();
|
||||
const errors = payload.errors.map((error: string) => error).join(' ');
|
||||
|
||||
Reference in New Issue
Block a user