Skip to main content

SpendOwlError

Errors that can occur within the SpendOwl SDK.
All SpendOwl operations are crash-proof. Errors are returned through completion handlers or thrown from async methods.

Error Cases

notConfigured

The SDK has not been configured. Error Code: 1001 Solution: Call SpendOwl.configure(apiKey:) before using other SDK methods.

invalidAPIKey

The provided API key is invalid. Error Code: 1002 Solution: Check that you’re using the correct API key from your SpendOwl dashboard.

networkError

A network error occurred. Error Code: 2001 Associated Value: The underlying network error. Notes:
  • The SDK automatically retries failed requests with exponential backoff
  • This error is returned after all retry attempts have failed

serverError

The server returned an error response. Error Code: 2002 Associated Values:
  • statusCode: The HTTP status code
  • message: An optional error message from the server

attributionUnavailable

Attribution is not available on this device. Error Code: 3001 Causes:
  • iOS version below 14.3
  • AdServices framework not available
  • Running in certain simulator configurations
Solution: This is expected on older devices. Handle gracefully.

attributionDenied

Attribution access was denied. Error Code: 3002 Causes:
  • User has enabled “Limit Ad Tracking”
  • MDM profile restricts ad tracking
  • Device privacy settings
Solution: This is normal for some users. Continue without attribution data.

encodingError

Failed to encode request data. Error Code: 4001 Notes: This is an internal error that should not occur in normal operation. If it does, please report it.

decodingError

Failed to decode the server response. Error Code: 4002 Associated Value: The underlying decoding error. Solution: This may indicate an API version mismatch. Update to the latest SDK version.

unknown

An unknown error occurred. Error Code: 9999 Associated Value: The underlying error for debugging.

Properties

errorDescription

A localized description of the error, suitable for display.

errorCode

A unique error code for programmatic error handling.

Error Handling Examples

Comprehensive Handling

Simple Handling

For most apps, simple error handling is sufficient:

Completion Handler Pattern

Debugging

Debug logging and troubleshooting

Troubleshooting

Common issues and solutions