DaemonApiException.fromDio constructor

DaemonApiException.fromDio(
  1. DioException error
)

Implementation

factory DaemonApiException.fromDio(DioException error) {
  final response = error.response;
  if (response != null) {
    return DaemonApiException.fromResponse(
      statusCode: response.statusCode,
      body: response.data,
      cause: error,
    );
  }
  return DaemonApiException(
    code: 'DAEMON_UNAVAILABLE',
    message: error.message ?? 'OpenTool daemon is unavailable',
    retryable: true,
    cause: error,
  );
}