IntelLabs / IntelLabs/atlas-cli
Refactor Error Handling to Use Types Instead of String Matching
Open
- Dominant language
- Rust
- Stars
- 22
- Forks
- 4
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 2
Description
The current error handling relies heavily on string matching:
```rust
e.to_string().contains("empty") || e.to_string().contains("no hashes") || e.to_string().contains("invalid input")
```
As @marcelamelara noted, it would be better to check error types. I agree, and while we might still need to partially rely on string content for some custom errors, we should aim to introduce a proper error type to improve code reliability.
Contributor guide
Assessment
This issue has not been assessed yet.