Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit 82f941b

Browse files
committed
Handle 422 response from all addons endpoints
1 parent 9b94de1 commit 82f941b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/addons.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ async function deleteAddon(settings, netlifyApiToken) {
5858
}
5959
})
6060

61+
if (response.status === 422) {
62+
throw new Error(`Error ${JSON.stringify(data)}`)
63+
}
64+
6165
return response
6266
}
6367

@@ -77,6 +81,10 @@ async function updateAddon(settings, netlifyApiToken) {
7781
}),
7882
})
7983

84+
if (response.status === 422) {
85+
throw new Error(`Error ${JSON.stringify(data)}`)
86+
}
87+
8088
return response
8189
}
8290

0 commit comments

Comments
 (0)