Results & Errors

Results & Errors

Every mutation returns QuickActionsResult<Unit>; nothing throws for control flow.

when (val result = quickActions.set(actions)) {
    is QuickActionsResult.Success -> Unit
    is QuickActionsResult.Failure -> log(result.error.code, result.error.message)
}
result.getOrNull(); result.errorOrNull()
CodeExceptionWhen
3001UnsupportedJVM, macOS, Wasm; Android launcher without pin support (requestPin)
3002InvalidActionBlank id or title, blank data key, duplicate ids, malformed JSON, unknown id for requestPin, or the platform rejected the shortcuts
3003TooManyActionsMore actions than maxActions; carries requested and max
3004RateLimitedAndroid refused the change while the app was in the background
3005PayloadTooLargeEncoded action over 1 KB
3006PlatformErrorThe platform failed for another reason (no launcher Activity, user locked, UIKit write failed)

Validation runs before any platform call: QuickAction.validate() and List<QuickAction>.validate(max) are public if you want to check early.