DioException constructor

DioException({
  1. required RequestOptions requestOptions,
  2. Response? response,
  3. DioExceptionType type = DioExceptionType.unknown,
  4. Object? error,
  5. StackTrace? stackTrace,
  6. String? message,
})

Prefer using one of the other constructors. They're most likely better fitting.

Implementation

DioException({
  required this.requestOptions,
  this.response,
  this.type = DioExceptionType.unknown,
  this.error,
  StackTrace? stackTrace,
  this.message,
}) : stackTrace = identical(stackTrace, StackTrace.empty)
          ? requestOptions.sourceStackTrace ?? StackTrace.current
          : stackTrace ??
              requestOptions.sourceStackTrace ??
              StackTrace.current;