Add methods for ErrorMessage class