IntelLabs / IntelLabs/atlas-cli

Refactor Error Handling to Use Types Instead of String Matching

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.