Skip to Content

GraffityARCloudError

public enum GraffityARCloudError: Error, Sendable, Equatable, with LocalizedError conformance. Available on iOS 18.0+.

Error cases

CaseMeaning and host response
.invalidAccessTokenMalformed token at initialization or backend HTTP 401. Obtain a valid token and create a fresh session; a runtime 401 triggers shutdown.
.locationNotAuthorizedLocation permission denied/restricted. Offer your app’s permission recovery flow.
.cameraNotAuthorizedCamera permission denied/restricted. Offer camera permission recovery.
.unsupportedDeviceARKit world tracking unsupported. Use a supported physical device.
.contentFetchFailed(reason: String, underlying: NSError?)Content fetch failed. Inspect the diagnostic reason and optional underlying error.
.vpsUnavailableVPS unreachable or no candidate section available. Check connection and mapped-venue coverage; use retry when appropriate.
.vpsAllAttemptsFailedLocalization attempts exhausted. Follow camera guidance and retry in the mapped area.
.localizationUnavailableShort-lived localization credential unavailable/refused. This does not itself mean the configured access token is invalid.
.navigationGraphUnavailableActive-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.
.networkUnavailableConnection unavailable. Restore it and retry.
.serverError(statusCode: Int)Other non-success server response. Inspect the status and retry only when appropriate.
.cancelledOperation 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.