Update m2.metrics.js

Added error handling to each individual metric.