-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(shared): add standard error codes for API errors (#45)
- Loading branch information
Showing
4 changed files
with
49 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package apierror | ||
|
||
import "github.com/gitpod-io/gitpod-sdk-go/shared" | ||
|
||
type ErrorCode = shared.ErrorCode | ||
|
||
const ErrorCodeCanceled = shared.ErrorCodeCanceled | ||
const ErrorCodeUnknown = shared.ErrorCodeUnknown | ||
const ErrorCodeInvalidArgument = shared.ErrorCodeInvalidArgument | ||
const ErrorCodeDeadlineExceeded = shared.ErrorCodeDeadlineExceeded | ||
const ErrorCodeNotFound = shared.ErrorCodeNotFound | ||
const ErrorCodeAlreadyExists = shared.ErrorCodeAlreadyExists | ||
const ErrorCodePermissionDenied = shared.ErrorCodePermissionDenied | ||
const ErrorCodeResourceExhausted = shared.ErrorCodeResourceExhausted | ||
const ErrorCodeFailedPrecondition = shared.ErrorCodeFailedPrecondition | ||
const ErrorCodeAborted = shared.ErrorCodeAborted | ||
const ErrorCodeOutOfRange = shared.ErrorCodeOutOfRange | ||
const ErrorCodeUnimplemented = shared.ErrorCodeUnimplemented | ||
const ErrorCodeInternal = shared.ErrorCodeInternal | ||
const ErrorCodeUnavailable = shared.ErrorCodeUnavailable | ||
const ErrorCodeDataLoss = shared.ErrorCodeDataLoss | ||
const ErrorCodeUnauthenticated = shared.ErrorCodeUnauthenticated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package shared | ||
|
||
type ErrorCode string | ||
|
||
const ( | ||
ErrorCodeCanceled ErrorCode = "canceled" | ||
ErrorCodeUnknown ErrorCode = "unknown" | ||
ErrorCodeInvalidArgument ErrorCode = "invalid_argument" | ||
ErrorCodeDeadlineExceeded ErrorCode = "deadline_exceeded" | ||
ErrorCodeNotFound ErrorCode = "not_found" | ||
ErrorCodeAlreadyExists ErrorCode = "already_exists" | ||
ErrorCodePermissionDenied ErrorCode = "permission_denied" | ||
ErrorCodeResourceExhausted ErrorCode = "resource_exhausted" | ||
ErrorCodeFailedPrecondition ErrorCode = "failed_precondition" | ||
ErrorCodeAborted ErrorCode = "aborted" | ||
ErrorCodeOutOfRange ErrorCode = "out_of_range" | ||
ErrorCodeUnimplemented ErrorCode = "unimplemented" | ||
ErrorCodeInternal ErrorCode = "internal" | ||
ErrorCodeUnavailable ErrorCode = "unavailable" | ||
ErrorCodeDataLoss ErrorCode = "data_loss" | ||
ErrorCodeUnauthenticated ErrorCode = "unauthenticated" | ||
) |