Skip to content

fix: replace deprecated Boom.wrap call #24

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

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

LonelyPrincess
Copy link
Contributor

@LonelyPrincess LonelyPrincess commented Jan 23, 2025

Main changes

  • 🐛 (fix)

Additional notes

This PR resolves #20, which relates to the following error that sometimes show up when using this module:

TypeError: Boom.wrap is not a function
    at errorMiddleware (C:\Development\app-he-hoges-web\node_modules\systemic-express\lib\default-middleware.js:36:20)
    at Layer.handle_error (C:\Development\app-he-hoges-web\node_modules\express\lib\router\layer.js:71:5)
    at trim_prefix (C:\Development\app-he-hoges-web\node_modules\express\lib\router\index.js:326:13)
    at C:\Development\app-he-hoges-web\node_modules\express\lib\router\index.js:286:9
    at Function.process_params (C:\Development\app-he-hoges-web\node_modules\express\lib\router\index.js:346:12)
    at next (C:\Development\app-he-hoges-web\node_modules\express\lib\router\index.js:280:10)
    at Layer.handle_error (C:\Development\app-he-hoges-web\node_modules\express\lib\router\layer.js:67:12)
    at trim_prefix (C:\Development\app-he-hoges-web\node_modules\express\lib\router\index.js:326:13)
    at C:\Development\app-he-hoges-web\node_modules\express\lib\router\index.js:286:9
    at Function.process_params (C:\Development\app-he-hoges-web\node_modules\express\lib\router\index.js:346:12)

This issue was pressumably introduced in #13, which upgraded the boom package from version 3.2.2 to 10.0.0. Boom.wrap has long became deprecated and replaced by Boom.boomify.

This also replaces the logger.log calls in the default error middleware which were causing this exception and the errors not to properly be displayed:

TypeError: logger.log is not a function
    at errorMiddleware (C:\Development\app-he-hoges-web\node_modules\systemic-express\lib\default-middleware.js:42:73)

@LonelyPrincess LonelyPrincess self-assigned this Jan 23, 2025
@Polpetta
Copy link

I've got to say, this fix is very useful. I ended up encountering this many times, and after trying out this branch the errors are now clear and it is possible to properly debug. I highly recommend approving this PR and releasing a new version of this package!

Thanks to @LonelyPrincess for tackling down this problem and fixing it 💯🎉

@LonelyPrincess LonelyPrincess force-pushed the fix/replace-wrong-boom-wrap-call branch from c1e75a1 to 2e7d34b Compare January 23, 2025 10:36
@LonelyPrincess LonelyPrincess changed the title fix: replace wrong boom wrap call fix: replace deprecated Boom.wrap call Jan 23, 2025
@LonelyPrincess LonelyPrincess merged commit 285a1df into master Jan 23, 2025
2 checks passed
@LonelyPrincess LonelyPrincess deleted the fix/replace-wrong-boom-wrap-call branch January 23, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Boom removed wrap function in 7.0.0
3 participants