-
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.
- Loading branch information
Showing
5 changed files
with
55 additions
and
0 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 |
---|---|---|
|
@@ -5,3 +5,6 @@ breaking: | |
lint: | ||
use: | ||
- DEFAULT | ||
ignore_only: | ||
PACKAGE_VERSION_SUFFIX: | ||
- errors/errors.proto |
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,25 @@ | ||
syntax = "proto3"; | ||
|
||
package errors; | ||
|
||
import "google/protobuf/descriptor.proto"; | ||
|
||
option go_package = "github.com/go-kratos/kratos/v2/errors;errors"; | ||
option java_multiple_files = true; | ||
option java_package = "com.github.kratos.errors"; | ||
option objc_class_prefix = "KratosErrors"; | ||
|
||
message Error { | ||
int32 code = 1; | ||
string reason = 2; | ||
string message = 3; | ||
map<string, string> metadata = 4; | ||
} | ||
|
||
extend google.protobuf.EnumOptions { | ||
int32 default_code = 1108; | ||
} | ||
|
||
extend google.protobuf.EnumValueOptions { | ||
int32 code = 1109; | ||
} |
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 @@ | ||
syntax = "proto3"; | ||
|
||
package librarian.sephirah.v1; | ||
|
||
import "errors/errors.proto"; | ||
|
||
option csharp_namespace = "TuiHub.Protos.Librarian.Sephirah.V1"; | ||
option go_package = "github.com/tuihub/librarian/sephirah;v1"; | ||
|
||
enum ErrorReason { | ||
option (errors.default_code) = 500; | ||
|
||
ERROR_REASON_UNSPECIFIED = 0 [(errors.code) = 500]; | ||
|
||
ERROR_REASON_BAD_REQUEST = 1 [(errors.code) = 400]; | ||
ERROR_REASON_UNAUTHORIZED = 2 [(errors.code) = 401]; | ||
ERROR_REASON_FORBIDDEN = 3 [(errors.code) = 403]; | ||
ERROR_REASON_NOT_FOUND = 4 [(errors.code) = 404]; | ||
ERROR_REASON_METHOD_NOT_ALLOWED = 5 [(errors.code) = 405]; | ||
ERROR_REASON_NOT_IMPLEMENTED = 6 [(errors.code) = 501]; | ||
ERROR_REASON_BAD_GATEWAY = 7 [(errors.code) = 502]; | ||
} |