Skip to content

Commit

Permalink
Fix raw value conversions for Error enum
Browse files Browse the repository at this point in the history
  • Loading branch information
jspahrsummers committed Sep 21, 2014
1 parent 9e0f28a commit c90a879
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ReactiveCocoa/Errors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public enum RACError: NSInteger {
/// `NSError`, or nil if the domain of the error is not `RACErrorDomain`.
public static func fromError(error: NSError) -> RACError? {
if error.domain == RACErrorDomain {
return fromRaw(error.code)
return self(rawValue: error.code)
} else {
return nil
}
}

/// An `NSError` object corresponding to this error code.
public var error: NSError {
return NSError(domain: RACErrorDomain, code: toRaw(), userInfo: nil)
return NSError(domain: RACErrorDomain, code: rawValue, userInfo: nil)
}
}

0 comments on commit c90a879

Please sign in to comment.