Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
Remove deprecated MapperError initializer
Browse files Browse the repository at this point in the history
This was deprecated in the last release. Since we're preparing for a
release with breaking changes, I'm going to go ahead and remove this.
  • Loading branch information
keith committed May 8, 2016
1 parent adc0da3 commit 72b91ef
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## Breaking

- None
- Remove the `MapperError` initializer
[Keith Smiley](https://github.com/keith)
[#53](https://github.com/lyft/mapper/pull/53)

## Enhancements

Expand Down
6 changes: 0 additions & 6 deletions Sources/MapperError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,4 @@ public enum MapperError: ErrorType {
case InvalidRawValueError(field: String, value: Any, type: Any.Type)
case MissingFieldError(field: String)
case TypeMismatchError(field: String, value: AnyObject, type: Any.Type)

@available(*, deprecated, message="MapperError initializer is deprecated. Use an enum case directly.")
@warn_unused_result
public init() {
self = .CustomError(field: nil, message: "Legacy MapperError initializer")
}
}
13 changes: 0 additions & 13 deletions Tests/Mapper/ErrorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,4 @@ final class ErrorTests: XCTestCase {
XCTFail()
}
}

func testDeprecatedInitializer() {
do {
let map = Mapper(JSON: [:])
_ = try map.from("string", transformation: { _ in throw MapperError() })
XCTFail()
} catch MapperError.CustomError(let field, let message) {
XCTAssertNil(field)
XCTAssertFalse(message.isEmpty)
} catch {
XCTFail()
}
}
}

0 comments on commit 72b91ef

Please sign in to comment.