PlaidEx.Support.HandlerResult (plaid_ex v1.0.0)

Copy Markdown View Source

Normalizes the return value of a user-supplied handler callback (webhook handlers, sync page handlers) into a consistent :ok | {:error, term()} shape.

Both PlaidEx.Sync.TransactionSync and PlaidEx.Webhooks.Dispatcher invoke user callbacks and need to interpret the result the same way — this was previously duplicated identically in both.

Summary

Functions

normalize(err)

@spec normalize(term()) :: :ok | {:error, term()}