Abrova
☰ Docs menu · Error handling
Coming soon. Abrova Push is coming soon. This page describes how it will work; it can’t be used yet.

Error Handling

Standardized error codes across all Abrova Push SDKs — connection (1000s), subscription (1100s), message (1200s), registration (1400s), permission (1600s). Handler examples for Flutter and Web.

Last updated: 27 Oct 2026

Handle errors gracefully with detailed error codes. All SDKs use standardized numeric error codes for consistent error handling across platforms.

Connection Errors (1000-1099)#

CodeNameDescription
1000CONNECTION_FAILEDFailed to connect to server
1001CONNECTION_TIMEOUTConnection timed out
1002CONNECTION_LOSTConnection to server was lost
1003CONNECTION_REFUSEDConnection was refused by server
1004AUTHENTICATION_FAILEDInvalid credentials or API key
1005SSL_ERRORSSL/TLS handshake failed
1006BROKER_UNAVAILABLEServer is unavailable

Subscription Errors (1100-1199)#

CodeNameDescription
1100SUBSCRIPTION_FAILEDFailed to subscribe to topic
1101UNSUBSCRIPTION_FAILEDFailed to unsubscribe from topic
1102INVALID_TOPICInvalid topic format

Message Errors (1200-1299)#

CodeNameDescription
1200MESSAGE_DELIVERY_FAILEDFailed to deliver message
1201MESSAGE_PARSE_ERRORFailed to parse message payload
1202MESSAGE_TIMEOUTMessage delivery timed out

Configuration Errors (1300-1399)

CodeNameDescription
1300INVALID_CONFIGInvalid configuration
1301MISSING_API_KEYAPI key is missing
1302MISSING_SERVER_URLServer URL is missing
1303INVALID_CREDENTIALSInvalid connection credentials
1304CONFIGURATION_FAILEDFailed to fetch configuration from server (Android, Flutter)

Registration Errors (1400-1499)#

CodeNameDescription
1400REGISTRATION_FAILEDDevice registration failed
1401DEVICE_ID_GENERATION_FAILEDFailed to generate device ID
1402SERVER_ERRORServer returned an error
1403NETWORK_ERRORNetwork request failed

State Errors (1500-1599)

CodeNameDescription
1500NOT_INITIALIZEDSDK is not initialized
1501NOT_CONNECTEDNot connected to server
1502ALREADY_CONNECTEDAlready connected to server
1503SERVICE_NOT_RUNNINGBackground service (Web: service worker) is not running
9999UNKNOWN_ERRORAn unknown error occurred

Permission Errors (1600-1699)#

Web SDK only. Android and Flutter define no 1600 codes; on iOS, 1600 / 1601 are the A/B testing errors variantNotFound / testNotFound.

CodeNameDescription
1600PERMISSION_DENIEDNotification permission denied
1601PERMISSION_DISMISSEDUser dismissed permission prompt

Flutter#

dart
AbrovaPush.onDetailedError((error) async {
  switch (error.errorCode) {
    case AbrovaPushErrorCode.connectionFailed:
      // Show "Connection failed" message
      // SDK will auto-retry
      break;

    case AbrovaPushErrorCode.authenticationFailed:
      // Invalid API key - check dashboard
      break;

    case AbrovaPushErrorCode.registrationFailed:
      // Retry registration
      await AbrovaPush.register(userId: userId);
      break;

    case AbrovaPushErrorCode.subscriptionFailed:
      // Topic subscription failed
      break;

    case AbrovaPushErrorCode.networkError:
      // Show offline indicator
      // SDK will reconnect when network returns
      break;

    default:
      print('Error: ${error.message}');
  }
});

Web#

typescript
import { AbrovaPushErrorCode } from '@abrova/push-web';

abrovaPush.onDetailedError((error) => {
  switch (error.code) {
    case AbrovaPushErrorCode.CONNECTION_FAILED:
      // Show "Connection failed" message — SDK auto-retries
      break;

    case AbrovaPushErrorCode.AUTHENTICATION_FAILED:
      // Invalid API key — check dashboard
      break;

    case AbrovaPushErrorCode.REGISTRATION_FAILED:
      // Retry registration
      abrovaPush.register({ userId });
      break;

    case AbrovaPushErrorCode.SUBSCRIPTION_FAILED:
      // Topic subscription failed
      break;

    case AbrovaPushErrorCode.NETWORK_ERROR:
      // Show offline indicator — SDK reconnects when network returns
      break;

    case AbrovaPushErrorCode.PERMISSION_DENIED:
      // User denied notification permission
      showPermissionRequestUI();
      break;

    default:
      console.error('Error:', error.code, error.message, error.details);
  }
});

Simple Error Handler#

For projects that just need to log errors without branching:

dart
AbrovaPush.onError((error) {
  // Log to crash reporting
  FirebaseCrashlytics.instance.recordError(
    Exception(error),
    null,
    reason: 'AbrovaPush error',
  );
});

Best Practices#

Always Set Error Handlers First

Register onError / onDetailedError before calling any other SDK methods

Log to Crash Reporting

Forward errors to Crashlytics / Sentry for debugging production issues

Show User-Friendly Messages

Translate technical error codes into messages users can understand

Don't Block the UI

The SDK auto-retries most errors — let it work

Handle networkError Gracefully

Show an offline indicator instead of treating it as a hard failure

Was this page helpful?
Report a problem