Track field validation errors

It can be useful to track field validation errors that show up in forms that your users fill out. To do so, call heap.track in your try/catch blocks to send the error message wherever you do validation (whether it's by field or only at the end of the form). As an example:

try {
 // do something
} catch (e) {
 heap.track('Error', {'message': e.message});
}