One of the responses to a call to AgeRangeService.shared.requestAgeRange is AgeRangeService.Error.invalidRequest.
This has no documentation. What on earth is an invalid request - I mean the app just calls the API, there's no parameters supplied or anything, how can the request ever be invalid?
If the app calls AgeRangeService.shared.requestAgeRange and gets this as a response then what is the app supposed to do with that?
The .invalidRequest error can be returned for a variety of reasons. My favourite one is passing in a negative age (-:
let response = try await AgeRangeService.shared.requestAgeRange(ageGates: 13, -1, 18, in: self)
// throws `.invalidRequest`
Are you asking because you’re seeing this error? Or because you’re trying to decide how to handle the error?
If it’s the latter, I think that’s a policy decision for you to make. This API exists so you can gate access to resources. If it throws an unexpected error, you have to decide whether to fail open or fail closed.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"