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 error message in announce response #1104

Closed
josecelano opened this issue Nov 22, 2024 · 0 comments · Fixed by #1114
Closed

Improve error message in announce response #1104

josecelano opened this issue Nov 22, 2024 · 0 comments · Fixed by #1114
Labels
- User - Enjoyable to Use our Software Code Cleanup / Refactoring Tidying and Making Neat Easy Good for Newcomers Enhancement / Feature Request Something New UX User Experience

Comments

@josecelano
Copy link
Member

When tracker clients send a bad request, they get an encoded response like this:

Example request: https://tracker.torrust-demo.com/announce

Response:

d14:failure reason149:Cannot parse query params for announce request: missing query params for announce request in src/servers/http/v1/extractors/announce_request.rs:75:23e

image

Some people might think it's a bug in the tracker. I would change the error message from:

Cannot parse query params for announce request: missing query params for announce request in src/servers/http/v1/extractors/announce_request.rs:75:23

to:

Bad request. Cannot parse query params for announce request: missing query params for announce request in src/servers/http/v1/extractors/announce_request.rs:75:23

We cannot change the dict field name failure reason because it's defined in the BEPs

@josecelano josecelano added Enhancement / Feature Request Something New Easy Good for Newcomers Code Cleanup / Refactoring Tidying and Making Neat - User - Enjoyable to Use our Software UX User Experience labels Nov 22, 2024
Binlogo added a commit to Binlogo/torrust-tracker that referenced this issue Nov 24, 2024
josecelano pushed a commit to josecelano/torrust-tracker that referenced this issue Dec 2, 2024
@josecelano josecelano linked a pull request Dec 2, 2024 that will close this issue
josecelano added a commit that referenced this issue Dec 2, 2024
3af1928 fix: [#1104] improve HTTP announce error message (Binlogo)

Pull request description:

  - Updated error messages in test cases to include "Bad request" for better clarity when query parameters cannot be parsed.
  - Modified the `From` implementations for `ParseQueryError` and `ParseAnnounceQueryError` to include "Bad request" in the error messages.

ACKs for top commit:
  josecelano:
    ACK 3af1928

Tree-SHA512: 87221cd34c73f7b9888df06957204908ac59d9a9f49052180994dcf5f45731412e94164849ab4ad45533a544c93b4f172af4a0ce8babe288cd036f1c4f8668cb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- User - Enjoyable to Use our Software Code Cleanup / Refactoring Tidying and Making Neat Easy Good for Newcomers Enhancement / Feature Request Something New UX User Experience
Projects
None yet
1 participant