| 1 |
// Copyright 2022 Google LLC |
| 2 |
// |
| 3 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
// you may not use this file except in compliance with the License. |
| 5 |
// You may obtain a copy of the License at |
| 6 |
// |
| 7 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
// |
| 9 |
// Unless required by applicable law or agreed to in writing, software |
| 10 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
// See the License for the specific language governing permissions and |
| 13 |
// limitations under the License. |
| 14 |
|
| 15 |
syntax = "proto3"; |
| 16 |
|
| 17 |
package error; |
| 18 |
|
| 19 |
option go_package = "github.com/googleapis/gax-go/v2/apierror/internal/proto;jsonerror"; |
| 20 |
|
| 21 |
|
| 22 |
// CustomError is an example of a custom error message which may be included |
| 23 |
// in an rpc status. It is not meant to reflect a standard error. |
| 24 |
message CustomError { |
| 25 |
|
| 26 |
// Error code for `CustomError`. |
| 27 |
enum CustomErrorCode { |
| 28 |
// Default error. |
| 29 |
CUSTOM_ERROR_CODE_UNSPECIFIED = 0; |
| 30 |
|
| 31 |
// Too many foo. |
| 32 |
TOO_MANY_FOO = 1; |
| 33 |
|
| 34 |
// Not enough foo. |
| 35 |
NOT_ENOUGH_FOO = 2; |
| 36 |
|
| 37 |
// Catastrophic error. |
| 38 |
UNIVERSE_WAS_DESTROYED = 3; |
| 39 |
|
| 40 |
} |
| 41 |
|
| 42 |
// Error code specific to the custom API being invoked. |
| 43 |
CustomErrorCode code = 1; |
| 44 |
|
| 45 |
// Name of the failed entity. |
| 46 |
string entity = 2; |
| 47 |
|
| 48 |
// Message that describes the error. |
| 49 |
string error_message = 3; |
| 50 |
} |