Class definition for error management