| 1 |
// Copyright 2021 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 |
import "google/protobuf/any.proto"; |
| 20 |
import "google/rpc/code.proto"; |
| 21 |
|
| 22 |
option go_package = "github.com/googleapis/gax-go/v2/apierror/internal/proto;jsonerror"; |
| 23 |
|
| 24 |
// The error format v2 for Google JSON REST APIs. |
| 25 |
// Copied from https://cloud.google.com/apis/design/errors#http_mapping. |
| 26 |
// |
| 27 |
// NOTE: This schema is not used for other wire protocols. |
| 28 |
message Error { |
| 29 |
// This message has the same semantics as `google.rpc.Status`. It uses HTTP |
| 30 |
// status code instead of gRPC status code. It has an extra field `status` |
| 31 |
// for backward compatibility with Google API Client Libraries. |
| 32 |
message Status { |
| 33 |
// The HTTP status code that corresponds to `google.rpc.Status.code`. |
| 34 |
int32 code = 1; |
| 35 |
// This corresponds to `google.rpc.Status.message`. |
| 36 |
string message = 2; |
| 37 |
// This is the enum version for `google.rpc.Status.code`. |
| 38 |
google.rpc.Code status = 4; |
| 39 |
// This corresponds to `google.rpc.Status.details`. |
| 40 |
repeated google.protobuf.Any details = 5; |
| 41 |
} |
| 42 |
// The actual error payload. The nested message structure is for backward |
| 43 |
// compatibility with Google API client libraries. It also makes the error |
| 44 |
// more readable to developers. |
| 45 |
Status error = 1; |
| 46 |
} |