Handle Structured Errors
This section deals with converting SDK failures into structured OfflineRegionError values and use stable error codes for localized messages, logging, and diagnostics. Regional Offline suspend APIs use Result to return errors. First convert the throwable to OfflineRegionError, then handle it by subtype or stable errorCode:
Stable error codes:
| Type | errorCode |
|---|---|
| StyleNotCached | STYLE_NOT_CACHED |
| NoInstalledRegions | NO_INSTALLED_REGIONS |
| Storage | STORAGE |
| Network | NETWORK |
| Unknown | UNKNOWN |
| NotInitialized | NOT_INITIALIZED |
| UnsupportedTileServer | UNSUPPORTED_TILE_SERVER |
message and the download progress field errorMessage are diagnostic text. They are not machine-readable protocols and must not be displayed directly as user-facing copy.