Skip to content

Commit

Permalink
fix: throw error instead of string (#9284)
Browse files Browse the repository at this point in the history
Fixes #9283

## Description

This is a minor issue around error visibility.

Here's how Bluebird's warning about the issue shows up:

![image](https://user-images.githubusercontent.com/397632/47270777-d47ce680-d52d-11e8-9a1d-1812a9837d5a.png)

`Warning: a promise was rejected with a non-error: [object String]`

To fix this, `rej(string)` must be called with a `new Error(string)` instead.
  • Loading branch information
justsml authored and pieh committed Oct 22, 2018
1 parent d662442 commit bcdd834
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/gatsby-source-wordpress/src/request-in-queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = function requestInQueue(tasks, opts = {}) {
)

q.on(`task_failed`, (id, err) => {
rej(`${id} failed with err: ${err}`)
rej(new Error(`${id} failed with err: ${err}`))
q.destroy()
})

Expand Down

0 comments on commit bcdd834

Please sign in to comment.