public enum NearbyError

  1. Object
  2. Enum<NearbyError>
  3. NearbyError

ImplementsComparable<NearbyError>

Typed error codes carried by every NearbyException thrown through the failure path of the com.codename1.nearby APIs. Callers branch on these via NearbyException.getError() rather than string-matching a message.

Enum constants

NOT_SUPPORTEDThe requested feature is not available on this port, this OS version or this hardware.
UNAUTHORIZEDA required runtime permission or OS authorization is missing.
RADIO_UNAVAILABLEThe radio this feature needs is switched off or otherwise unavailable right now – UWB disabled in settings, Bluetooth powered off, Wi-Fi off.
PEER_UNAVAILABLEThe peer, accessory or endpoint could not be reached, or moved out of range before the operation completed.
SESSION_FAILEDA ranging or transport session could not be started – an invalid configuration, too many concurrent sessions, or a platform-level refusal.
SESSION_INVALIDATEDA running session was invalidated by the platform and cannot be resumed.
INVALID_TOKENThe supplied token, accessory configuration, endpoint identifier or device filter could not be decoded or used, or came from a different platform.
TIMEOUTThe platform never delivered a completion callback within the safety timeout, or a discovery/connection attempt timed out.
BUSYA conflicting operation is already in progress – for example a second association flow while the system chooser is open.
USER_CANCELEDThe user dismissed a system dialog (the device chooser, the association prompt, a permission request) or the operation was cancelled through AsyncResource.cancel().
IO_ERRORTransport-level I/O failure while moving a payload.
UNKNOWNUnclassified failure; the exception message carries the details.

Methods

public static NearbyError[] values()
public static NearbyError valueOf(String name)

Inherited methods

Enum constant details

NOT_SUPPORTED

NOT_SUPPORTED
The requested feature is not available on this port, this OS version or this hardware. The capability queries – isSupported() on each entry point, plus the finer-grained RangingCapabilities – let cross-platform code branch before ever seeing this code, and the inert fallback bridges fail every operation with it.

UNAUTHORIZED

UNAUTHORIZED
A required runtime permission or OS authorization is missing. On Android that is UWB_RANGING, the Bluetooth runtime grants or location; on iOS it is the Nearby Interaction or local network authorization the user declined. See the requestPermissions method on the relevant entry point.

RADIO_UNAVAILABLE

RADIO_UNAVAILABLE
The radio this feature needs is switched off or otherwise unavailable right now – UWB disabled in settings, Bluetooth powered off, Wi-Fi off. Unlike NOT_SUPPORTED this is recoverable: the same call may succeed once the user turns the radio on.

PEER_UNAVAILABLE

PEER_UNAVAILABLE
The peer, accessory or endpoint could not be reached, or moved out of range before the operation completed.

SESSION_FAILED

SESSION_FAILED
A ranging or transport session could not be started – an invalid configuration, too many concurrent sessions, or a platform-level refusal.

SESSION_INVALIDATED

SESSION_INVALIDATED
A running session was invalidated by the platform and cannot be resumed. Start a new one.

INVALID_TOKEN

INVALID_TOKEN

The supplied token, accessory configuration, endpoint identifier or device filter could not be decoded or used, or came from a different platform. Tokens are opaque and are not portable between iOS and Android.

A device filter reports this rather than being dropped: an association request whose filter cannot be installed would otherwise offer the user every visible device instead of the ones asked for, and they could associate the wrong accessory from a picker that was never meant to show it.

TIMEOUT

TIMEOUT
The platform never delivered a completion callback within the safety timeout, or a discovery/connection attempt timed out.

BUSY

BUSY
A conflicting operation is already in progress – for example a second association flow while the system chooser is open.

USER_CANCELED

USER_CANCELED
The user dismissed a system dialog (the device chooser, the association prompt, a permission request) or the operation was cancelled through AsyncResource.cancel().

IO_ERROR

IO_ERROR
Transport-level I/O failure while moving a payload. Blocking stream payloads throw plain java.io.IOException instead.

UNKNOWN

UNKNOWN
Unclassified failure; the exception message carries the details.

Method details

values

public static NearbyError[] values()

valueOf

public static NearbyError valueOf(String name)