Move error message parsing to the ClientError class