Skip to content

Commit

Permalink
A few comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Anviking committed Jan 16, 2016
1 parent 95de128 commit d46329e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Sources/DecodingError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,23 @@

import Foundation

/// Errors conforming DecodingError will be caught and rethrown in the decoding process with updated metadata.
public protocol DecodingError: ErrorType {
/// The JSON key path to the object that failed to be decoded
var path: [String] {get set}

/// The object that failed to be decoded
var object: AnyObject {get}

/// The root JSON object for which the `path` can be used to find `object`
var rootObject: AnyObject? {get set}


var formattedPath: String {get}
}

extension DecodingError {
/// Represents the path to the object that failed decoding with "." as a separator.
public var formattedPath: String {
return path.joinWithSeparator(".")
}
Expand Down

0 comments on commit d46329e

Please sign in to comment.