# Report Errors lambda

# Introduction
The Report Errors lambda can be used by the state machine to communicate success and failures to both Support and customer Label Managers, where necessary.

Currently, support will always be cc'd into emails and label managers will be informed where SubmitProduct validation fails.

# Context errors format

When adding errors to the `errors` item in context, it is possible to format it as a single dict, or list of dicts when throwing an exception.

Ensure when errors are raised or reraised that they are chained to ensure that Sentry has access to the full stacktrace, e.g.:

except Exception as ex:
        raise EmailClientError('Failed to send email') from ex

