bp-sdk-error-event-container
Usage
Including this component in your DOM will enable the SDK to start emitting custom sdkError
events that you can listen for as they bubble up the DOM.
Note We will only emit sdkError
events for errors that are internally thrown by the SDK. Normal errors will continue to function as they would have and will not be part of this flow.
It also includes the ability to pass in an error handling function into the component if you need a more behance integration with something like a logging system or APM such as Sentry, NewRelic, etc. (We do not override the capability for your APM to automatically detect errors, so this is a fallback.)
Using a function hook
Optionally, you may pass a function to the errorHandler
prop that accepts an Error
as a parameter.
Properties
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
errorHandler | -- | Function hook that will be called with SDK Errors that get thrown | (error: Error) => void | undefined |
isDebug | is-debug | Debug flag injected from redux store | boolean | false |
Events
Event | Description | Type |
---|---|---|
sdkError | Emits DOM event with any SDK errors that are thrown | CustomEvent<{ error: Error; }> |
Built with StencilJS