Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve checks for Error in onerror handlers #1468

Merged
merged 1 commit into from Jun 13, 2020

Conversation

julienw
Copy link
Contributor

@julienw julienw commented Jun 2, 2020

Fixes #1466

expose: true
});

assert.doesNotThrow(() => app.onerror(error));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked that this is failing in master.

.get('/')
.expect(418);

await gotRightErrorPromise;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked that both assertions are failing in master.

@@ -248,7 +281,7 @@ describe('ctx.onerror(err)', () => {
});

app.use(async ctx => {
throw {key: 'value'}; // eslint-disable-line no-throw-literal
throw { key: 'value' }; // eslint-disable-line no-throw-literal
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like my editor fixed some lint warnings automatically, please tell me if you'd prefer that I revert that.

@codecov
Copy link

codecov bot commented Jun 2, 2020

Codecov Report

Merging #1468 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1468   +/-   ##
=======================================
  Coverage   99.38%   99.38%           
=======================================
  Files           4        4           
  Lines         485      489    +4     
  Branches      132      136    +4     
=======================================
+ Hits          482      486    +4     
  Partials        3        3           
Impacted Files Coverage Δ
lib/application.js 98.31% <100.00%> (+0.02%) ⬆️
lib/context.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9ee6584...244a1b4. Read the comment docs.

@dead-horse dead-horse merged commit e2030c7 into koajs:master Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Node's internal errors aren't properly handled by koa's onerror handler in some situations
2 participants