RxOptionalError.swift 507 B

123456789101112131415
  1. import Foundation
  2. public enum RxOptionalError: Error, CustomStringConvertible {
  3. case foundNilWhileUnwrappingOptional(Any.Type)
  4. case emptyOccupiable(Any.Type)
  5. public var description: String {
  6. switch self {
  7. case .foundNilWhileUnwrappingOptional(let type):
  8. return "Found nil while trying to unwrap type <\(String(describing: type))>"
  9. case .emptyOccupiable(let type):
  10. return "Empty occupiable of type <\(String(describing: type))>"
  11. }
  12. }
  13. }