Implemented Error Codes and Exceptions