Skip to content

Commit

Permalink
uplink-c: port new errors from uplink
Browse files Browse the repository at this point in the history
We have two new errors:
uplink.ErrStorageLimitExceeded
uplink.ErrSegmentsLimitExceeded

Fixes #11

Change-Id: I02f60185ba109eb62da795a8cf5e4db1dea4e190
  • Loading branch information
mniewrzal committed Feb 17, 2022
1 parent 2df5a38 commit 12b6f40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ func mallocError(err error) *C.UplinkError {
cerror.code = C.UPLINK_ERROR_TOO_MANY_REQUESTS
case errors.Is(err, uplink.ErrBandwidthLimitExceeded):
cerror.code = C.UPLINK_ERROR_BANDWIDTH_LIMIT_EXCEEDED
case errors.Is(err, uplink.ErrStorageLimitExceeded):
cerror.code = C.UPLINK_ERROR_STORAGE_LIMIT_EXCEEDED
case errors.Is(err, uplink.ErrSegmentsLimitExceeded):
cerror.code = C.UPLINK_ERROR_SEGMENTS_LIMIT_EXCEEDED

case errors.Is(err, uplink.ErrBucketNameInvalid):
cerror.code = C.UPLINK_ERROR_BUCKET_NAME_INVALID
Expand Down
2 changes: 2 additions & 0 deletions uplink_definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ typedef struct UplinkError {
#define UPLINK_ERROR_INVALID_HANDLE 0x04
#define UPLINK_ERROR_TOO_MANY_REQUESTS 0x05
#define UPLINK_ERROR_BANDWIDTH_LIMIT_EXCEEDED 0x06
#define UPLINK_ERROR_STORAGE_LIMIT_EXCEEDED 0x07
#define UPLINK_ERROR_SEGMENTS_LIMIT_EXCEEDED 0x08

#define UPLINK_ERROR_BUCKET_NAME_INVALID 0x10
#define UPLINK_ERROR_BUCKET_ALREADY_EXISTS 0x11
Expand Down

0 comments on commit 12b6f40

Please sign in to comment.