recappi 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1719,6 +1719,37 @@ function recordErrorState(error51, selection) {
1719
1719
  }
1720
1720
  return { kind: "error", message: String(error51), ...selection ? { selection } : {} };
1721
1721
  }
1722
+ function transcribeHandoffErrorCopy(error51) {
1723
+ const descriptor = error51 instanceof Error && isRecord7(error51) && isRecord7(error51.descriptor) ? error51.descriptor : void 0;
1724
+ const code = typeof descriptor?.code === "string" ? descriptor.code : isRecord7(error51) && typeof error51.code === "string" ? error51.code : void 0;
1725
+ switch (code) {
1726
+ case "auth.not_logged_in":
1727
+ return "Sign in to Recappi before transcribing this recording.";
1728
+ case "auth.unauthorized":
1729
+ return "Your Recappi session needs attention. Sign in and retry.";
1730
+ case "input.not_found":
1731
+ return "The local recording file is no longer available.";
1732
+ case "input.not_file":
1733
+ return "The saved recording is not a readable audio file.";
1734
+ case "input.unsupported_audio":
1735
+ return "This recording format is not supported yet.";
1736
+ case "input.duration_unavailable":
1737
+ return "This recording could not be checked yet.";
1738
+ case "cloud.conflict.upload_in_progress":
1739
+ return "This recording is already being uploaded.";
1740
+ case "cloud.recording_not_ready":
1741
+ return "The recording is still being prepared. Try again shortly.";
1742
+ case "cloud.job_failed":
1743
+ return "Transcription failed on Recappi Cloud. Please try again.";
1744
+ case "cloud.job_timed_out":
1745
+ return "Transcription took too long. Please try again.";
1746
+ case "cloud.http_error":
1747
+ case "cloud.invalid_response":
1748
+ return "Recappi Cloud could not start transcription. Please try again.";
1749
+ default:
1750
+ return "Could not start transcription. Please try again.";
1751
+ }
1752
+ }
1722
1753
  function permissionItemsFromRecordError(data) {
1723
1754
  const sidecarError = isRecord7(data) ? data : void 0;
1724
1755
  const sidecarData = isRecord7(sidecarError?.data) ? sidecarError.data : void 0;
@@ -1986,7 +2017,7 @@ function AppShell({
1986
2017
  ...artifact,
1987
2018
  uploadStatus: "failed",
1988
2019
  transcriptionStatus: "failed",
1989
- error: error51 instanceof Error ? error51.message : String(error51)
2020
+ error: transcribeHandoffErrorCopy(error51)
1990
2021
  }
1991
2022
  });
1992
2023
  setNotice("Transcription failed. Press enter to retry.");