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:
Alec Jacobs
2022-05-27 10:22:01 -07:00
parent 845c7f8852
commit 3cf02b6e9c
+5
View File
@@ -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(' ');