Skip to content

Commit

Permalink
Updated error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ehlersd committed Sep 28, 2021
1 parent 7b49ce7 commit f14babc
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 33 deletions.
28 changes: 14 additions & 14 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/Alamofire/Alamofire.git",
"state": {
"branch": null,
"revision": "eaf6e622dd41b07b251d8f01752eab31bc811493",
"version": "5.4.1"
"revision": "d120af1e8638c7da36c8481fd61a66c0c08dc4fc",
"version": "5.4.4"
}
},
{
Expand All @@ -24,53 +24,53 @@
"repositoryURL": "https://github.com/DoubleNode/DNSCore.git",
"state": {
"branch": null,
"revision": "435b14a10b05bde1aca508648e677dd979894574",
"version": "1.4.1"
"revision": "1b3f9e7729bd5376a987e2a96a069790a9ce0a11",
"version": "1.6.0"
}
},
{
"package": "DNSCoreThreading",
"repositoryURL": "https://github.com/DoubleNode/DNSCoreThreading.git",
"state": {
"branch": null,
"revision": "a41bf74644708924903ea0b6b9ec56903b7e28f2",
"version": "1.4.0"
"revision": "04ab2c39ee3de89391de797f6aeeab154b98c916",
"version": "1.6.0"
}
},
{
"package": "DNSDataObjects",
"repositoryURL": "https://github.com/DoubleNode/DNSDataObjects.git",
"state": {
"branch": null,
"revision": "560fccf44b875642ebf2a4eb2557e6f1201d11ed",
"version": "1.4.2"
"revision": "fdf1d90782bad947947926ba0f4744d6228afb7c",
"version": "1.6.0"
}
},
{
"package": "DNSError",
"repositoryURL": "https://github.com/DoubleNode/DNSError.git",
"state": {
"branch": null,
"revision": "5075e2c42a79355346af633a778c5ce3359b38a9",
"version": "1.4.0"
"revision": "606b1986e1b78bb007a82597631ef0b249ce63b8",
"version": "1.6.0"
}
},
{
"package": "DNSProtocols",
"repositoryURL": "https://github.com/DoubleNode/DNSProtocols.git",
"state": {
"branch": null,
"revision": "10ace81d7c70b3c572fb07b8c5daa9e62636e82b",
"version": "1.4.1"
"revision": "536ff164b4716a4a775c6e7cd45fee0eb67a7209",
"version": "1.6.1"
}
},
{
"package": "SFSymbol",
"repositoryURL": "https://github.com/Nirma/SFSymbol",
"state": {
"branch": null,
"revision": "08dda98b2ba4a36653becaab6f4234f5fc2592d2",
"version": "1.0.0"
"revision": "90ec3de89965be4612b496211e1f31a363a1df42",
"version": "1.1.0"
}
},
{
Expand Down
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ let package = Package(
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/Alamofire/Alamofire.git", from: "5.0.2"),
.package(url: "https://github.com/DoubleNode/DNSCoreThreading.git", from: "1.4.0"),
.package(url: "https://github.com/DoubleNode/DNSError.git", from: "1.4.0"),
.package(url: "https://github.com/DoubleNode/DNSProtocols.git", from: "1.4.0"),
.package(url: "https://github.com/DoubleNode/DNSCoreThreading.git", from: "1.6.0"),
.package(url: "https://github.com/DoubleNode/DNSError.git", from: "1.6.0"),
.package(url: "https://github.com/DoubleNode/DNSProtocols.git", from: "1.6.1"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ Once you have your Swift package set up, adding Alamofire as a dependency is as

```swift
dependencies: [
.package(url: "https://github.com/DoubleNode/DNSProtocolsAdvanced.git", from: "1.4.0")
.package(url: "https://github.com/DoubleNode/DNSProtocolsAdvanced.git", from: "1.6.0")
]
```

## Dependencies

- Alamofire v5.0.2+
- DNSCoreThreading v1.4.0+
- DNSError v1.4.0+
- DNSProtocols v1.4.0+
- DNSCoreThreading v1.6.0+
- DNSError v1.6.0+
- DNSProtocols v1.6.1+

## Credits

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

import DNSError

public extension DNSCodeLocation {
typealias protocolsAdvanced = DNSProtocolsAdvancedCodeLocation
}
open class DNSProtocolsAdvancedCodeLocation: DNSCodeLocation {
override open class var domainPreface: String { "com.doublenode.protocolsAdvanced." }
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import DNSError
import DNSProtocols
import Foundation

public enum PTCLNFCTagsError: Error
{
public extension DNSError {
typealias NFCTags = DNSNFCTagsError
}
public enum DNSNFCTagsError: DNSError {
case unknown(_ codeLocation: DNSCodeLocation)
case notSupported(_ codeLocation: DNSCodeLocation)
case systemError(error: Error, _ codeLocation: DNSCodeLocation)
case timeout(_ codeLocation: DNSCodeLocation)
}

extension PTCLNFCTagsError: DNSError {
public static let domain = "NFC"
public enum Code: Int
{
Expand Down Expand Up @@ -91,17 +91,22 @@ extension PTCLNFCTagsError: DNSError {
}
}

// (object: Any?, error: Error?)
public typealias PTCLNFCTagsBlockVoidArrayNFCNDEFMessageDNSError = ([NFCNDEFMessage], DNSError?) -> Void
public typealias PTCLNFCTagsResultArrayNFCNDEFMessage =
Result<[NFCNDEFMessage], DNSError.NFCTags>
public typealias PTCLNFCTagsBlockVoidArrayNFCNDEFMessage =
(PTCLNFCTagsResultArrayNFCNDEFMessage) -> Void

public protocol PTCLNFCTags: PTCLProtocolBase {
var callNextWhen: PTCLProtocol.Call.NextWhen { get }
var nextWorker: PTCLNFCTags? { get }

public protocol PTCLNFCTags_Protocol: PTCLBase_Protocol {
var nextWorker: PTCLNFCTags_Protocol? { get }

init()
init(nextWorker: PTCLNFCTags_Protocol)

func register(nextWorker: PTCLNFCTags,
for callNextWhen: PTCLProtocol.Call.NextWhen)

// MARK: - Business Logic / Single Item CRUD

func doScanTags(for key: String,
with progress: PTCLProgressBlock?,
and block: PTCLNFCTagsBlockVoidArrayNFCNDEFMessageDNSError?) throws
and block: PTCLNFCTagsBlockVoidArrayNFCNDEFMessage?) throws
}

0 comments on commit f14babc

Please sign in to comment.