manageLinkException method

void manageLinkException(
  1. QueryResult<Object?> result
)

Implementation

void manageLinkException(QueryResult result) {
  final exception = result.exception?.linkException;
  if (exception == null) return;

  if (exception is HttpLinkParserException) {
    if (exception.response.statusCode == 429) {
      throw const ArchethicTooManyRequestsException();
    }
  }

  throw ArchethicConnectionException(
    exception.toString(),
  );
}