0001 // 0002 // DecodeError.swift 0003 // Himotoki 0004 // 0005 // Created by Syo Ikeda on 8/29/15. 0006 // Copyright © 2015 Syo Ikeda. All rights reserved. 0007 // 0008 0009 public enum DecodeError: ErrorType { 0010 case MissingKeyPath
DecodeError.swift:14 public func typeMismatch<T>(expected: String, actual: T, keyPath: KeyPath?) -> DecodeError {DecodeError.swift:15 return DecodeError.TypeMismatch(expected: expected, actual: String(actual), keyPath: keyPath)Extractor.swift:32 throw DecodeError.MissingKeyPath(keyPath)Extractor.swift:38 throw DecodeError.MissingKeyPath(keyPath + missing)Extractor.swift:40 throw DecodeError.TypeMismatch(expected: expected, actual: actual, keyPath: keyPath)Extractor.swift:56 throw DecodeError.MissingKeyPath(keyPath)Extractor.swift:70 throw DecodeError.MissingKeyPath(keyPath)(KeyPath) 0011 case TypeMismatch
Extractor.swift:32 throw DecodeError.MissingKeyPath(keyPath)Extractor.swift:37 } catch let DecodeError.MissingKeyPath(missing) {Extractor.swift:38 throw DecodeError.MissingKeyPath(keyPath + missing)Extractor.swift:48 } catch let DecodeError.MissingKeyPath(missing) where missing == keyPath {Extractor.swift:56 throw DecodeError.MissingKeyPath(keyPath)Extractor.swift:70 throw DecodeError.MissingKeyPath(keyPath)(expected: String, actual: String, keyPath: KeyPath?) 0012 } 0013 0014 public func typeMismatch
DecodeError.swift:15 return DecodeError.TypeMismatch(expected: expected, actual: String(actual), keyPath: keyPath)Extractor.swift:39 } catch let DecodeError.TypeMismatch(expected, actual, _) {Extractor.swift:40 throw DecodeError.TypeMismatch(expected: expected, actual: actual, keyPath: keyPath)<T>(expected: String, actual: T, keyPath: KeyPath?) -> DecodeError { 0015 return DecodeError.TypeMismatch(expected: expected, actual: String(actual), keyPath: keyPath) 0016 } 0017
decode.swift:23 throw typeMismatch("Array", actual: object, keyPath: nil)decode.swift:37 throw typeMismatch("Dictionary", actual: object, keyPath: nil)Extractor.swift:22 throw typeMismatch("Dictionary", actual: rawValue, keyPath: keyPath)RawRepresentable.swift:14 throw typeMismatch("rawValue for \(self)", actual: rawValue, keyPath: nil)StandardLib.swift:43 throw typeMismatch("\(T.self)", actual: rawValue, keyPath: nil)