-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat: Handle new avvio
error codes
#3106
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Just need to rebase a bit.
@@ -277,7 +277,7 @@ t.test('onReady cannot add lifecycle hooks', t => { | |||
fastify.addHook('onRequest', (request, reply, done) => {}) | |||
} catch (error) { | |||
t.ok(error) | |||
t.equal(error.message, 'root plugin has already booted') | |||
t.equal(error.message, 'Root plugin has already booted') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a check on the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! done in cbb0e73
test/plugin.test.js
Outdated
@@ -845,8 +845,8 @@ test('plugin metadata - dependencies (nested)', t => { | |||
} | |||
}) | |||
|
|||
test('pluginTimeout', t => { | |||
t.plan(2) | |||
test('pluginTimeout', { only: true }, t => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test('pluginTimeout', { only: true }, t => { | |
test('pluginTimeout', t => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in cbb0e73
@@ -855,12 +855,14 @@ test('pluginTimeout', t => { | |||
}) | |||
fastify.ready((err) => { | |||
t.ok(err) | |||
t.equal(err.code, 'ERR_AVVIO_PLUGIN_TIMEOUT') | |||
t.equal(err.message, | |||
"fastify-plugin: Plugin did not start in time: 'function (app, opts, done) { -- // to no call done on purpose'. You may have forgotten to call 'done' function or to resolve a Promise") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a test with a named function too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, made a new one in cbb0e73
cbb0e73
to
b176784
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good work, just a nit
@@ -277,7 +277,9 @@ t.test('onReady cannot add lifecycle hooks', t => { | |||
fastify.addHook('onRequest', (request, reply, done) => {}) | |||
} catch (error) { | |||
t.ok(error) | |||
t.equal(error.message, 'root plugin has already booted') | |||
t.equal(error.message, 'Root plugin has already booted') | |||
// TODO: look where the error pops up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this TODO here? Can you resolve it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm taking a look right now. I just wanted to push the changes already made for keeping track of the progress 👍
Also, this is quite weird. The thing is that it seems it throws sync, and for instance, I'm not able to fully catch it, do you have any idea what I'm missing?
docs/Errors.md
Outdated
<a name="FST_ERR_PLUGIN_TIMEOUT"></a> | ||
#### FST_ERR_PLUGIN_TIMEOUT | ||
|
||
Plugin did not start in time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we share the timeout default here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in d315fed
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Closes #2842
Note:
avvio
until then is pointing out tofastify/avvio#next
branch for dependency.Checklist
npm run test
andnpm run benchmark
and the Code of conduct