GraffityARCloudError
public enum GraffityARCloudError: Error, Sendable, Equatable, with LocalizedError conformance. Available on iOS 18.0+.
Error cases
| Case | Meaning and host response |
|---|---|
.invalidAccessToken | Malformed token at initialization or backend HTTP 401. Obtain a valid token and create a fresh session; a runtime 401 triggers shutdown. |
.locationNotAuthorized | Location permission denied/restricted. Offer your app’s permission recovery flow. |
.cameraNotAuthorized | Camera permission denied/restricted. Offer camera permission recovery. |
.unsupportedDevice | ARKit world tracking unsupported. Use a supported physical device. |
.contentFetchFailed(reason: String, underlying: NSError?) | Content fetch failed. Inspect the diagnostic reason and optional underlying error. |
.vpsUnavailable | VPS unreachable or no candidate section available. Check connection and mapped-venue coverage; use retry when appropriate. |
.vpsAllAttemptsFailed | Localization attempts exhausted. Follow camera guidance and retry in the mapped area. |
.localizationUnavailable | Short-lived localization credential unavailable/refused. This does not itself mean the configured access token is invalid. |
.navigationGraphUnavailable | Active-section navigation graph or requested loaded POI unavailable. Check localization and authored data. |
.navigationRouteUnavailable(destination: String, fromSection: String) | Destination cannot be routed from the current section. Choose another destination or correct authored transitions/data. |
.networkUnavailable | Connection unavailable. Restore it and retry. |
.serverError(statusCode: Int) | Other non-success server response. Inspect the status and retry only when appropriate. |
.cancelled | Operation cancelled; usually no user-facing error is needed. |
The built-in UI provides retry for network/VPS availability failures and a destination-picker recovery for unroutable destinations in navigation mode. Host recovery for permissions or authentication remains your app’s responsibility.
Initialization versus runtime errors
Use do / catch around try GraffityARCloud(configuration:). Later errors arrive through graffityARCloud(_:didFailWith:) and state.lastError.
import GraffityARCloud
@MainActor
final class SessionErrors: @preconcurrency GraffityARCloudDelegate {
func graffityARCloud(_ sdk: GraffityARCloud, didFailWith error: GraffityARCloudError) {
switch error {
case .cancelled:
return
case .invalidAccessToken:
// Remove this session and request a new token in your app.
print("A new access token is required.")
case .cameraNotAuthorized, .locationNotAuthorized:
// Offer your app's permission recovery UI.
print(error.localizedDescription)
default:
print(error.localizedDescription)
}
}
}Retain and assign this delegate before presentation. UI messages can use error.errorDescription; it is localized, and .cancelled has no description. failureReason and recoverySuggestion currently return nil. Do not use localized copy as a stable error identifier; switch on enum cases.
See permissions and session replacement.