Added triggering logic and tests for command error alerts.