Implemented Error Class

Implmented error class by giving an error message in the error lable