XMLError.swift 849 B

1234567891011121314151617181920212223242526
  1. /**
  2. * https://github.com/tadija/AEXML
  3. * Copyright (c) Marko Tadić 2014-2019
  4. * Licensed under the MIT license. See LICENSE file.
  5. */
  6. import Foundation
  7. #if canImport(FoundationXML)
  8. import FoundationXML
  9. #endif
  10. /// A type representing error value that can be thrown or inside `error` property of `XMLElement`.
  11. public enum XMLError: Error {
  12. /// This error can be raise when the value conversion has failed.
  13. case valueConversionFailed
  14. /// This will be inside `error` property of `XMLElement` when subscript is used for not-existing element.
  15. case elementNotFound
  16. /// This will be inside `error` property of `XMLDocument` when there is no root element.
  17. case rootElementMissing
  18. /// `XMLDocument` can throw this error on `init` or `loadXMLData` if parsing with `XMLParser` was not successful.
  19. case parsingFailed
  20. }