feat: Handle new avvio error codes#3106
Conversation
jsumners
left a comment
There was a problem hiding this comment.
Looks good to me. Just need to rebase a bit.
| } catch (error) { | ||
| t.ok(error) | ||
| t.equal(error.message, 'root plugin has already booted') | ||
| t.equal(error.message, 'Root plugin has already booted') |
test/plugin.test.js
Outdated
|
|
||
| test('pluginTimeout', t => { | ||
| t.plan(2) | ||
| test('pluginTimeout', { only: true }, t => { |
There was a problem hiding this comment.
| test('pluginTimeout', { only: true }, t => { | |
| test('pluginTimeout', t => { |
| 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.
Could we add a test with a named function too?
cbb0e73 to
b176784
Compare
| 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.
why is this TODO here? Can you resolve it?
There was a problem hiding this comment.
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.
Could we share the timeout default here?
|
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:
avviountil then is pointing out tofastify/avvio#nextbranch for dependency.Checklist
npm run testandnpm run benchmarkand the Code of conduct