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

Commit bcd1b35

Browse files
committed
Only convert to json for failed response
1 parent e454f62 commit bcd1b35

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/addons.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,8 @@ async function updateAddon(settings, netlifyApiToken) {
8282
}),
8383
})
8484

85-
const data = await response.json()
86-
8785
if (response.status === 422) {
86+
const data = await response.json()
8887
throw new Error(data.error)
8988
}
9089

0 commit comments

Comments
 (0)