exception_detail.proto 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. syntax = "proto3";
  15. package google.apps.drive.labels.v2;
  16. option go_package = "google.golang.org/genproto/googleapis/apps/drive/labels/v2;labels";
  17. option java_multiple_files = true;
  18. option java_outer_classname = "ExceptionDetailProto";
  19. option java_package = "com.google.apps.drive.labels.v2";
  20. // Every ExceptionType maps to one and only one Exception class. This allows
  21. // internal clients to identify the exact server exception that caused the
  22. // error for debugging and logging purposes.
  23. // Add new ExceptionTypes to EXCEPTION_TYPE_TO_ERROR_CODE_MAP in
  24. // j/c/g/apps/boq/metadata/model/service/exceptions/CategoryExceptionHelper
  25. enum ExceptionType {
  26. // Unknown ExceptionType.
  27. EXCEPTION_TYPE_UNSPECIFIED = 0;
  28. // The required field is missing.
  29. FIELD_REQUIRED = 1;
  30. // Unable to create a metamodel with the given ID because it already exists.
  31. METAMODEL_ALREADY_EXISTS = 2;
  32. // Metamodel was not found
  33. METAMODEL_NOT_FOUND = 3;
  34. // Metamodel state transition isn't allowed.
  35. ILLEGAL_METAMODEL_STATE_TRANSITION = 4;
  36. // Metamodel deprecation policy is invalid.
  37. INVALID_METAMODEL_DEPRECATION_POLICY = 5;
  38. // Cannot delete a metamodel due to the pending deprecation policy.
  39. METAMODEL_DELETION_DENIED_UNTIL = 6;
  40. // A Field value is invalid.
  41. INVALID_FIELD = 7;
  42. // Precondition failed when updating a metamodel
  43. METAMODEL_PRECONDITION_FAILED = 8;
  44. // Multiple fields had the same key.
  45. DUPLICATE_FIELD_KEY = 9;
  46. // Removing a field from a Metamodel (e.g. a published Metamodel) is not
  47. // permitted.
  48. ILLEGAL_FIELD_REMOVAL = 10;
  49. // Cannot specify field options for a different field type.
  50. ILLEGAL_FIELD_OPTIONS_FOR_FIELD = 11;
  51. // Some changes are not supported
  52. UNSUPPORTED_CHANGE_TO_PUBLISHED_METAMODEL = 12;
  53. // Cannot change the metamodel state in an update
  54. ILLEGAL_METAMODEL_STATE_TRANSITION_IN_UPDATE = 13;
  55. // The page token is expired
  56. PAGE_TOKEN_EXPIRED = 14;
  57. // The user is not authorized to make the request.
  58. NOT_AUTHORIZED = 15;
  59. // Illegal field state transition
  60. ILLEGAL_FIELD_STATE_TRANSITION = 16;
  61. // Illegal choice set option state transition
  62. ILLEGAL_CHOICE_SET_OPTION_STATE_TRANSITION = 17;
  63. // Invalid choice set options
  64. INVALID_CHOICE_SET_OPTIONS = 18;
  65. // Invalid field key
  66. INVALID_FIELD_KEY = 19;
  67. // A specified property on a field is outside the allowed range.
  68. INVALID_FIELD_PROPERTY_RANGE = 20;
  69. // A localized string wasn't valid. This may be because the locale is invalid,
  70. // its missing a default value, or the translation is empty for a set locale.
  71. INVALID_LOCALIZED_STRING = 21;
  72. // cannot change a property on a published field
  73. ILLEGAL_CHANGE_TO_PUBLISHED_FIELD = 22;
  74. // A field update is not inclusive of the previous value
  75. INVALID_FIELD_UPDATE_NOT_INCLUSIVE = 23;
  76. // A field update is not inclusive of the previous value
  77. INVALID_CHOICE_SET_STATE = 24;
  78. // An unknown error occurred
  79. INTERNAL_SERVER_ERROR = 500;
  80. }
  81. // Normalized internal-only message that identifies the exact exception that
  82. // caused the error on the server.
  83. message ExceptionDetail {
  84. // The type of exception that occurred.
  85. // required
  86. ExceptionType error_type = 1;
  87. }