The error()
method is for tracking custom errors.
Syntax
error(customError)
Parameters
customError
- Error you want to track. It may be
string
,Error
,PromiseRejectionEvent
,ErrorEvent
or serializableObject
.
Return value
void
Examples
Simple error
Smartlook.error('Error occured')
Serializable object
Smartlook.error({
message: 'Error occured',
type: 'internal',
})
Promise catch
try {
await fetch(url)
} catch (error) {
Smartlook.error(error)
}