Skip to main content
The Web SDK reports errors as values, not exceptions.
  • show() never rejects: a failure (network error, unexpected exception) resolves as { status: 'dismissed', reason: { type: 'error', error } }. No try/catch needed. Calling show() before configure() is reported by the named reason 'notConfigured' rather than a generic error. See Not-configured.
  • configure() returns false on invalid input (and logs the reason); it does not throw.
  • Fire-and-forget methods (identify(), setUserAttributes(), reset()) log errors to the console rather than throwing.

Reading an error from a result

Not-configured

Calling show() before configure() is one specific integration mistake with one fix, so it gets its own reason rather than a generic error payload:
show()’s options.onError also fires for it, with INITIALIZATION_ERROR.

EncoreError

ErrorCode

INITIALIZATION_ERROR is the one you’ll most likely see during integration: it means a method ran before configure() succeeded.

An unrecognized use case

INVALID_REQUEST is the one error that fires both onError and onNotGranted, and it fires before any presentation attempt. It means the useCase passed to show() or placement() was not 'reduceChurn' or 'rewardUsers'. That is an integration bug rather than a normal outcome, so don’t confuse it with the silent unavailable a valid use case with nothing to present produces. The values Encore sends over the wire are deliberately not accepted here; passing one produces exactly this error.