inferenceErrorText function

String inferenceErrorText(
  1. dynamic l10n,
  2. dynamic probe
)

The text for a refusal of the worker or the loader, by its code.

Implementation

String inferenceErrorText(AppLocalizations l10n, InferenceProbe probe) =>
    switch (probe.errorCode) {
      'unverifiable' => l10n.inferenceErrorUnverifiable,
      'hash-mismatch' => l10n.inferenceErrorHashMismatch,
      'fetch-failed' => l10n.inferenceErrorFetch,
      'build-not-staged' ||
      'no-bundle' ||
      'bad-manifest' => l10n.inferenceErrorNotStaged,
      'worker-failed' => l10n.inferenceErrorWorker,
      'model-missing' => l10n.inferenceErrorModelMissing,
      'model-hash-mismatch' => l10n.inferenceErrorModelHash,
      'timeout' => l10n.inferenceErrorTimeout,
      notWebCode => l10n.inferenceErrorNotWeb,
      _ => l10n.inferenceErrorOther(
        probe.errorCode ?? '',
        probe.errorMessage ?? '',
      ),
    };