convertError<TTarget> method

ParseResult<TTarget> convertError<TTarget>()

Converts this result to a new target type by propagating the exception provider. This parse result must already be an error result.

Returns: A ParseResult for the target type, with the same error as this result.

Implementation

ParseResult<TTarget> convertError<TTarget>() {
  if (success) {
    // InvalidOperationException
    throw StateError('ConvertError should not be called on a successful parse result');
  }
  return ParseResult<TTarget>._error(_errorProvider, _continueAfterErrorWithMultipleFormats);
}