AppSignal JavaScript plug v0.2.2 Appsignal.JSPlug View Source
A plug for sending JavaScript errors to AppSignal.
Phoenix usage
Add the following parser to your router.
plug Plug.Parsers,
parsers: [:urlencoded, :multipart, :json],
pass: ["*/*"],
json_decoder: Poison
Add the Appsignal.JSPlug to your endpoint.ex file.
use Appsignal.Phoenix # Below the AppSignal (Phoenix) plug
plug Appsignal.JSPlug
Now send the errors with a POST request to the /appsignal_error_catcher
endpoint.
Required JSON payload fields are:
name-String- the error name.message-String- the error message.backtrace-List<String>- the error backtrace. A list ofStrings with lines and linenumbers.environment-Map<String, any>- aMapof environment values that are relevant to the error. Such as the browser type and version, the user's Operating System, screen width and height.
Optional fields are:
action-String- the action name in which the error occured.params-Map<String, any>- aMapof parameters for this action, function or page request params.
For more information see the AppSignal Front-end error handling Beta docs: https://docs.appsignal.com/front-end/error-handling.html