Add functionality for adding errors