status.proto 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright 2024 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. syntax = "proto3";
  15. package google.rpc;
  16. import "google/protobuf/any.proto";
  17. option cc_enable_arenas = true;
  18. option go_package = "google.golang.org/genproto/googleapis/rpc/status;status";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "StatusProto";
  21. option java_package = "com.google.rpc";
  22. option objc_class_prefix = "RPC";
  23. // The `Status` type defines a logical error model that is suitable for
  24. // different programming environments, including REST APIs and RPC APIs. It is
  25. // used by [gRPC](https://github.com/grpc). Each `Status` message contains
  26. // three pieces of data: error code, error message, and error details.
  27. //
  28. // You can find out more about this error model and how to work with it in the
  29. // [API Design Guide](https://cloud.google.com/apis/design/errors).
  30. message Status {
  31. // The status code, which should be an enum value of
  32. // [google.rpc.Code][google.rpc.Code].
  33. int32 code = 1;
  34. // A developer-facing error message, which should be in English. Any
  35. // user-facing error message should be localized and sent in the
  36. // [google.rpc.Status.details][google.rpc.Status.details] field, or localized
  37. // by the client.
  38. string message = 2;
  39. // A list of messages that carry the error details. There is a common set of
  40. // message types for APIs to use.
  41. repeated google.protobuf.Any details = 3;
  42. }