Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwindy committed Apr 11, 2023
1 parent c52efdc commit e96c433
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# RichError

A description of this package.
## Info:

A simple error protocol for structuring errors. Data can be passed along for use with debugging.

## Example implementation:

### Declaration:

```
struct NetworkRequestManagerError: RichError {
typealias ErrorKind = NetworkRequestManagerErrorKind
enum NetworkRequestManagerErrorKind {
case non200StatusCode
case nonJsonResponse
}
var kind: NetworkRequestManagerErrorKind
var data: [String: Any?]
}
```

### Call site:

```
NetworkRequestManagerError(kind: .nonJsonResponse, data: ["request": request, "response": response, "data": data])
```

0 comments on commit e96c433

Please sign in to comment.