• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

agama-project / agama / 15919434531

27 Jun 2025 06:07AM UTC coverage: 76.147% (+11.3%) from 64.88%
15919434531

push

github

web-flow
fix(rust): fix error formatting (#2471)

## Problem

The error format is pretty confusing:

```
$ agama --insecure --host 'https:/localhost' auth login
> Please enter the root password: ********
Error: error sending request for url (https://https/localhost/api/auth): client error (Connect): dns error: failed to lookup address information: Name or service not known: failed to lookup address information: Name or service not known
```

## Solution

Although far from ideal, introducing a minimal change makes it more
readable (kind of):

```
$ agama --insecure --host 'https://localhost' auth login`
> Please enter the root password: ********
error sending request for url (https://localhost/api/auth)

Caused by:
    0: client error (Connect)
    1: tcp connect error: Connection refused (os error 111)
    2: Connection refused (os error 111)
```

## Now what?

Now we need to invest in improving the error messages. As you can see,
the following one looks repetitive:

```
Retrieving data from URL http://192.168.122.1/agama/scripts.jsonnets

Caused by:
    0: Could not retrieve 'http://192.168.122.1/agama/scripts.jsonnets': [22] HTTP response code said error (The requested URL returned error: 404)
    1: [22] HTTP response code said error (The requested URL returned error: 404)
```

Just a [minor change](08271203c) helps to
get a better message:

```
Retrieving data from URL http://192.168.122.1/agama/scripts.jsonnets

Caused by:
    0: Could not retrieve http://192.168.122.1/agama/scripts.jsonnets
    1: [22] HTTP response code said error (The requested URL returned error: 404)
```

## Testing

- *Tested manually*

1861 of 3413 branches covered (54.53%)

Branch coverage included in aggregate %.

21733 of 27572 relevant lines covered (78.82%)

61.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/rust/agama-server/src/web/common/progress.rs


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc