fix: allow minor = 0 in allocateMinor response validation
This commit is contained in:
parent
734a18356f
commit
9ce7b9571a
1 changed files with 2 additions and 2 deletions
|
|
@ -201,8 +201,8 @@ actor APIClient {
|
||||||
guard resp.OK else {
|
guard resp.OK else {
|
||||||
throw APIError.serverError(resp.MESSAGE ?? resp.ERROR ?? "Failed to allocate minor")
|
throw APIError.serverError(resp.MESSAGE ?? resp.ERROR ?? "Failed to allocate minor")
|
||||||
}
|
}
|
||||||
guard let minor = resp.BeaconMinor, minor > 0 else {
|
guard let minor = resp.BeaconMinor, minor >= 0 else {
|
||||||
throw APIError.serverError("API returned invalid minor value: \(resp.BeaconMinor ?? 0). Service point may not be configured correctly.")
|
throw APIError.serverError("API returned invalid minor value: \(resp.BeaconMinor.map(String.init) ?? "nil"). Service point may not be configured correctly.")
|
||||||
}
|
}
|
||||||
return minor
|
return minor
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue