TextFormatDecodingError.swift 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Sources/SwiftProtobuf/TextFormatDecodingError.swift - Protobuf text format decoding errors
  2. //
  3. // Copyright (c) 2014 - 2017 Apple Inc. and the project authors
  4. // Licensed under Apache License v2.0 with Runtime Library Exception
  5. //
  6. // See LICENSE.txt for license information:
  7. // https://github.com/apple/swift-protobuf/blob/main/LICENSE.txt
  8. //
  9. // -----------------------------------------------------------------------------
  10. ///
  11. /// Protobuf text format decoding errors
  12. ///
  13. // -----------------------------------------------------------------------------
  14. public enum TextFormatDecodingError: Error {
  15. /// Text data could not be parsed
  16. case malformedText
  17. /// A number could not be parsed
  18. case malformedNumber
  19. /// Extraneous data remained after decoding should have been complete
  20. case trailingGarbage
  21. /// The data stopped before we expected
  22. case truncated
  23. /// A string was not valid UTF8
  24. case invalidUTF8
  25. /// The data being parsed does not match the type specified in the proto file
  26. case schemaMismatch
  27. /// Field names were not compiled into the binary
  28. case missingFieldNames
  29. /// A field identifier (name or number) was not found on the message
  30. case unknownField
  31. /// The enum value was not recognized
  32. case unrecognizedEnumValue
  33. /// Text format rejects conflicting values for the same oneof field
  34. case conflictingOneOf
  35. /// An internal error happened while decoding. If this is ever encountered,
  36. /// please file an issue with SwiftProtobuf with as much details as possible
  37. /// for what happened (proto definitions, bytes being decoded (if possible)).
  38. case internalExtensionError
  39. /// Reached the nesting limit for messages within messages while decoding.
  40. case messageDepthLimit
  41. }