Skip to content

Commit

Permalink
Update error codes to match changes in the API (#27)
Browse files Browse the repository at this point in the history
* Update error codes 

* Bump project version

* Update changelog
  • Loading branch information
Jonxslays authored Sep 18, 2023
1 parent bf0f3c1 commit 539cb0d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# v0.2.0 (Sep 2023)

## Additions

- Add `NotUnique` and `InvalidKeyType` variants to `ErrorCode` enum.

## Changes

- Rename `UsageExceeded` error code to `KeyUsageExceeded`.

# v0.1.0 (Aug 2023)

## Additions
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "unkey"
description = "An asynchronous Rust SDK for the Unkey API."
version = "0.1.0"
version = "0.2.0"
edition = "2021"
authors = ["Jonxslays"]
readme = "README.md"
Expand Down
10 changes: 8 additions & 2 deletions src/models/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@ pub enum ErrorCode {
/// Not authorized for resource.
Unauthorized,

/// You have exceeded your usage.
UsageExceeded,
/// The key has exceeded its usage.
KeyUsageExceeded,

/// An internal server error occurred with the api.
InternalServerError,

// An invalid key type was used (shouldn't happen usually).
InvalidKeyType,

// The identifier is in use by another resource.
NotUnique,

/// Reserved for unknown interactions.
#[serde(other)]
Unknown,
Expand Down

0 comments on commit 539cb0d

Please sign in to comment.