Skip to content

Commit

Permalink
Added missingData network base error
Browse files Browse the repository at this point in the history
  • Loading branch information
ehlersd committed Oct 2, 2024
1 parent d89f126 commit 06e0793
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DoubleNode/DNSCore.git",
"state" : {
"revision" : "2675d55fce67c027d9c8209d9d2ec2812858d9b4",
"version" : "1.11.6"
"revision" : "3865941b872e85ad1a199612963092d02ba8b7e4",
"version" : "1.11.7"
}
},
{
Expand Down Expand Up @@ -122,8 +122,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/Juanpe/SkeletonView.git",
"state" : {
"revision" : "739a4f5d78731bebc48811c75fa9e1f4c4cef23e",
"version" : "1.30.4"
"revision" : "2f5274827d310e32c09325dd3e0007120940988e",
"version" : "1.31.0"
}
},
{
Expand Down
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ let package = Package(
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/Alamofire/Alamofire.git", from: "5.9.0"),
.package(url: "https://github.com/DoubleNode/DNSCore.git", from: "1.11.6"),
.package(url: "https://github.com/Alamofire/Alamofire.git", from: "5.9.1"),
.package(url: "https://github.com/DoubleNode/DNSCore.git", from: "1.11.7"),
.package(url: "https://github.com/DoubleNode/DNSCoreThreading.git", from: "1.11.1"),
.package(url: "https://github.com/DoubleNode/DNSDataObjects.git", from: "1.11.7"),
.package(url: "https://github.com/DoubleNode/DNSError.git", from: "1.11.0"),
.package(url: "https://github.com/DoubleNode/DNSDataObjects.git", from: "1.11.8"),
.package(url: "https://github.com/DoubleNode/DNSError.git", from: "1.11.1"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ Once you have your Swift package set up, adding Alamofire as a dependency is as

```swift
dependencies: [
.package(url: "https://github.com/DoubleNode/DNSProtocols.git", from: "1.11.10")
.package(url: "https://github.com/DoubleNode/DNSProtocols.git", from: "1.11.11")
]
```

## Dependencies

- Alamofire v5.9.0+
- DNSCore v1.11.6+
- Alamofire v5.9.1+
- DNSCore v1.11.7+
- DNSCoreThreading v1.11.1+
- DNSDataObjects v1.11.7+
- DNSError v1.11.0+
- DNSDataObjects v1.11.8+
- DNSError v1.11.1+

## Credits

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public enum NETPTCLNetworkBaseError: DNSError {
case insufficientAccess(_ codeLocation: DNSCodeLocation)
case expiredAccessToken(_ codeLocation: DNSCodeLocation)
case alreadyLinked(_ codeLocation: DNSCodeLocation)
case missingData(_ codeLocation: DNSCodeLocation)

public static let domain = "NETBASE"
public enum Code: Int {
Expand All @@ -54,6 +55,7 @@ public enum NETPTCLNetworkBaseError: DNSError {
case insufficientAccess = 2010
case expiredAccessToken = 2011
case alreadyLinked = 2012
case missingData = 2013
}

public var nsError: NSError! {
Expand Down Expand Up @@ -170,6 +172,12 @@ public enum NETPTCLNetworkBaseError: DNSError {
return NSError.init(domain: Self.domain,
code: Self.Code.alreadyLinked.rawValue,
userInfo: userInfo)
case .missingData(let codeLocation):
var userInfo = codeLocation.userInfo
userInfo[NSLocalizedDescriptionKey] = self.errorString
return NSError.init(domain: Self.domain,
code: Self.Code.missingData.rawValue,
userInfo: userInfo)
}
}
public var errorDescription: String? {
Expand Down Expand Up @@ -237,6 +245,9 @@ public enum NETPTCLNetworkBaseError: DNSError {
case .alreadyLinked:
return String(format: NSLocalizedString("NETBASE-AlreadyLinked%@", comment: ""),
" (\(Self.domain):\(Self.Code.alreadyLinked.rawValue))")
case .missingData:
return String(format: NSLocalizedString("NETBASE-MissingData%@", comment: ""),
" (\(Self.domain):\(Self.Code.missingData.rawValue))")
}
}
public var failureReason: String? {
Expand All @@ -259,7 +270,8 @@ public enum NETPTCLNetworkBaseError: DNSError {
.adminRequired(let codeLocation),
.insufficientAccess(let codeLocation),
.expiredAccessToken(let codeLocation),
.alreadyLinked(let codeLocation):
.alreadyLinked(let codeLocation),
.missingData(let codeLocation):
return codeLocation.failureReason
}
}
Expand Down

0 comments on commit 06e0793

Please sign in to comment.