Skip to content

Commit

Permalink
fix error parsing for read
Browse files Browse the repository at this point in the history
I introduced this bug a while ago 🫣
  • Loading branch information
tbeseda committed Oct 19, 2023
1 parent 21a2c83 commit 4e0b437
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/_read.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = async function read ({ scope = 'apps', token, appID, envID, pat
catch (err) {
if (err.body) {
// tiny 7 reads do NOT parse JSON errors; see tiny#37
const { error, errors } = err.body
const { error, errors } = JSON.parse(err.body)
if (error) throw Error(error)
if (errors) throw Error(Array.isArray(errors) ? errors.at(-1) : errors)
else throw Error('unknown_error')
Expand Down

0 comments on commit 4e0b437

Please sign in to comment.