Skip to content

Commit

Permalink
Provide localizedDescription for our errors
Browse files Browse the repository at this point in the history
Commit minor changes to Social and OMG extensions.
  • Loading branch information
mxcl committed Dec 4, 2017
1 parent 3ee3fe0 commit ca17677
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Extensions/OMGHTTPURLRQ
2 changes: 1 addition & 1 deletion Extensions/Social
Submodule Social updated 1 files
+2 −0 Cartfile.resolved
12 changes: 9 additions & 3 deletions Sources/Error.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public enum PMKError: Error {
case flatMap(Any, Any.Type)
}

extension PMKError: CustomStringConvertible {
public var description: String {
extension PMKError: CustomDebugStringConvertible {
public var debugDescription: String {
switch self {
case .flatMap(let obj, let type):
return "Could not `flatMap<\(type)>`: \(obj)"
Expand All @@ -35,11 +35,17 @@ extension PMKError: CustomStringConvertible {
case .badInput:
return "Bad input was provided to a PromiseKit function"
case .cancelled:
return "The operation was cancelled"
return "The asynchronous sequence was cancelled"
}
}
}

extension PMKError: LocalizedError {
public var errorDescription: String? {
return debugDescription
}
}


//////////////////////////////////////////////////////////// Cancellation

Expand Down

0 comments on commit ca17677

Please sign in to comment.