The Wayback Machine - https://web.archive.org/web/20230220165310/https://github.com/vapor/vapor/issues/2720
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 debugging for errors thrown when missing required Parameters #2720

Closed
rausnitz opened this issue Oct 28, 2021 · 3 comments · Fixed by #2833
Closed

Improve debugging for errors thrown when missing required Parameters #2720

rausnitz opened this issue Oct 28, 2021 · 3 comments · Fixed by #2833
Assignees
Labels
good first issue Good for newcomers

Comments

@rausnitz
Copy link
Sponsor

We had a typo in our code that led to this error: https://github.com/vapor/vapor/blob/main/Sources/Vapor/Routing/Parameters%2BRequire.swift#L23. It was hard to debug in part because of the vague Abort(.internalServerError). I suggest adding a reason value to the Abort, unless that would be considered a breaking change. I can submit a PR if you're interested.

@0xTim 0xTim added the good first issue Good for newcomers label Oct 31, 2021
@0xTim
Copy link
Member

0xTim commented Nov 3, 2021

@rausnitz I think a log should definitely be added and probably a reason as well. Happy for a PR or you can leave it for someone else to pick up

@rausnitz
Copy link
Sponsor Author

rausnitz commented Nov 3, 2021

@0xTim If I were to introduce a Logger into this function, should I follow the pattern used here and just give it a different label?

logger: Logger = Logger(label: "dot-env-loggger")

@0xTim
Copy link
Member

0xTim commented Nov 3, 2021

You can just use the requests logger, with req.logger.debug etc

@BennyDeBock BennyDeBock added this to To do in Beginner Issues Mar 4, 2022
@BennyDeBock BennyDeBock self-assigned this May 17, 2022
@VaporBot VaporBot moved this from To do to In progress in Beginner Issues May 17, 2022
@VaporBot VaporBot moved this from In progress to Done in Beginner Issues May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
3 participants