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

Catch exceptions in parent.override #50

Merged
merged 3 commits into from
Feb 16, 2018
Merged

Conversation

jsumners
Copy link
Member

@jsumners jsumners commented Feb 16, 2018

This PR should allow fastify/fastify#778 to be fixed.

N.B.: I think Boot.prototype.start should return this. Do you?

plugin.js Outdated
try {
this.server = this.parent.override(server, func, this.opts)
} catch (err) {
return cb(err)
Copy link
Member

Choose a reason for hiding this comment

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

Can you also add a debug log?

@mcollina
Copy link
Member

N.B.: I think Boo.prototype.start should return this. Do you?

Yes, can you send another PR?

plugin.js Outdated
try {
this.server = this.parent.override(server, func, this.opts)
} catch (err) {
debug('exec errored', name)
Copy link
Member

@delvedor delvedor Feb 16, 2018

Choose a reason for hiding this comment

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

I think is more correct (´override errored: '${name}'´, err) :D

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

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

LGTM

@mcollina mcollina merged commit 64b564f into fastify:master Feb 16, 2018
@jsumners jsumners deleted the pass-error branch February 16, 2018 18:16
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.

3 participants