You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
750 B

  1. //
  2. // PromiseError.swift
  3. // then
  4. //
  5. // Created by Sacha Durand Saint Omer on 23/02/2017.
  6. // Copyright © 2017 s4cha. All rights reserved.
  7. //
  8. import Foundation
  9. public enum PromiseError: Error {
  10. case `default`
  11. case validationFailed
  12. case retryInvalidInput
  13. case unwrappingFailed
  14. case timeout
  15. }
  16. extension PromiseError: Equatable { }
  17. public func == (lhs: PromiseError, rhs: PromiseError) -> Bool {
  18. switch (lhs, rhs) {
  19. case (.default, .default):
  20. return true
  21. case (.validationFailed, .validationFailed):
  22. return true
  23. case (.retryInvalidInput, .retryInvalidInput):
  24. return true
  25. case (.unwrappingFailed, .unwrappingFailed):
  26. return true
  27. default:
  28. return false
  29. }
  30. }