Skip to content

Improve error messages with helpful hints and solutions#203

Open
zarch wants to merge 1 commit into
Julien-cpsn:mainfrom
zarch:improve-error-messages
Open

Improve error messages with helpful hints and solutions#203
zarch wants to merge 1 commit into
Julien-cpsn:mainfrom
zarch:improve-error-messages

Conversation

@zarch
Copy link
Copy Markdown

@zarch zarch commented Mar 9, 2026

As a new atac user, I encountered difficulties understanding why certain API requests were failing. This PR improves error messages to guide users in identifying issues and finding solutions.

Changes

  • Add format_error_message() function to analyze reqwest errors;
  • Detect TLS certificate errors and suggest --accept-invalid-certs flag;
  • Detect hostname mismatches and suggest --accept-invalid-hostnames flag;
  • Provide specific suggestions for timeout, connection, and redirect errors;
  • Include contextual hints for most error types.

Before vs After

Before:

error sending request for url (https://example.com/api)

After:

error sending request for url (https://example.com/api)

💡 TLS Certificate Error: The server is using a self-signed or untrusted certificate.
   Solution: Use --accept-invalid-certs flag or enable 'Accept invalid certs' in TUI settings

- Add format_error_message() function to analyze reqwest errors
- Detect TLS certificate errors and suggest --accept-invalid-certs flag
- Detect hostname mismatch errors and suggest --accept-invalid-hostnames flag
- Provide specific suggestions for timeout, connection, and redirect errors
- Include contextual hints for all error types
- Error messages now guide users to the correct solution

Before: 'error sending request for url (...)'
After: Provides specific error type, explanation, and solution with flags
@Julien-cpsn
Copy link
Copy Markdown
Owner

Hello,

Just to let you know, I started reviewing and working on your PR.

Have a great day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants