Creates a new MetricsReporter instance.
The messaging instance used to communicate with the native layer
Static
DEFAULT_The default exception message
Static
MESSAGE_The message ID used for reporting metrics to the native layer
Static
METRIC_The metric name used for exception reporting
Sends a reportMetric
event with metric name exception
, getting message
and kind
from the params
object. If no params object is passed, defaults are used.
Optional
params: ExceptionMetricParamsThe exception parameters containing message and kind (both optional)
Sends a reportMetric
event with metric name exception
, getting message and kind from the error object. The kind
property is inferred from error.name
.
If no error object is passed, a default error is reported.
If an invalid error object is passed, nothing is reported.
Optional
error: ErrorThe error to report
Sends a standard reportMetric
event to the native layer.
The metric event to report, must contain a metricName
Class for reporting metrics and exceptions to the native layer.