send the error type as a parameter