Skip to content

Commit

Permalink
Merge pull request #220 from qonversion/release/5.1.3
Browse files Browse the repository at this point in the history
Release 5.1.3
  • Loading branch information
SpertsyanKM authored Aug 30, 2024
2 parents a636241 + 3fff5ea commit bb05f5d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion QonversionSandwich.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
excluded_files = ['ios/sandwich/AutomationsSandwich.swift', 'ios/sandwich/AutomationsEventListener.swift', 'ios/sandwich/AutomationsMappers.swift']
s.name = 'QonversionSandwich'
s.version = '5.1.2'
s.version = '5.1.3'
s.summary = 'qonversion.io'
s.swift_version = '5.0'
s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
buildscript {
ext {
release = [
versionName: "5.1.2"
versionName: "5.1.3"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion fastlane/report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@



<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000172">
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000175">

</testcase>

Expand Down
19 changes: 17 additions & 2 deletions ios/sandwich/Mappers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,25 @@ extension NSError {
Qonversion.APIError.rateLimitExceeded.rawValue: "ApiRateLimitExceeded",
]

let strCode = (domain == QonversionApiErrorDomain ? apiErrorCodes[code] : codes[code]) ?? "Unknown"
var strCode = domain == QonversionApiErrorDomain ? apiErrorCodes[code] : codes[code]

// The below workarounds would be fixed in the coming major release.
if (strCode == nil && domain == NSURLErrorDomain) {
strCode = apiErrorCodes[Qonversion.Error.connectionFailed.rawValue]
}

if (strCode == nil && domain == QonversionErrorDomain) {
let authErrorCodes = QNUtils.authErrorsCodes() as? [NSNumber] ?? []

if (code >= 500 && code < 600) {
strCode = apiErrorCodes[Qonversion.APIError.internalError.rawValue]
} else if (authErrorCodes.contains { $0.intValue == code }) {
strCode = apiErrorCodes[Qonversion.APIError.invalidCredentials.rawValue]
}
}

return SandwichError(
code: strCode,
code: strCode ?? "Unknown",
domain: domain,
details: localizedDescription,
additionalMessage: userInfo[NSDebugDescriptionErrorKey] as? String
Expand Down

0 comments on commit bb05f5d

Please sign in to comment.