This repository was archived by the owner on Oct 10, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ async function createAddon(settings, netlifyApiToken) {
2121 const data = await response . json ( )
2222
2323 if ( response . status === 422 ) {
24- throw new Error ( ` ${ JSON . stringify ( data . error ) } ` )
24+ throw new Error ( data . error )
2525 }
2626
2727 return data
@@ -40,7 +40,7 @@ async function getAddons(siteId, netlifyApiToken) {
4040 const data = await response . json ( )
4141
4242 if ( response . status === 422 ) {
43- throw new Error ( ` ${ JSON . stringify ( data . error ) } ` )
43+ throw new Error ( data . error )
4444 }
4545
4646 return data
@@ -60,7 +60,7 @@ async function deleteAddon(settings, netlifyApiToken) {
6060
6161 if ( response . status === 422 ) {
6262 const data = await response . json ( )
63- throw new Error ( ` ${ JSON . stringify ( data . error ) } ` )
63+ throw new Error ( data . error )
6464 }
6565
6666 return response
@@ -85,7 +85,7 @@ async function updateAddon(settings, netlifyApiToken) {
8585 const data = await response . json ( )
8686
8787 if ( response . status === 422 ) {
88- throw new Error ( ` ${ JSON . stringify ( data . error ) } ` )
88+ throw new Error ( data . error )
8989 }
9090
9191 return response
You can’t perform that action at this time.
0 commit comments