Skip to content

Commit

Permalink
fix: circular structure in error object (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
malstoun authored and gregberge committed Apr 5, 2018
1 parent c96714c commit 96333ca
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,15 @@ export function getLoadableState(

return Promise.all(mappedQueries).then(() => {
if (errors.length > 0) {
const error =
errors.length === 1
? errors[0]
: new Error(
`${
errors.length
} errors were thrown when importing your modules.`,
)
error.queryErrors = errors
throw error
if (errors.length === 1) {
throw errors[0];
} else {
const err = new Error(
`${errors.length} errors were thrown when importing your modules.`
);
err.queryErrors = errors
throw err;
}
}

return new DeferredState(tree)
Expand Down

0 comments on commit 96333ca

Please sign in to comment.