Add error message tracking for mongoose