From 83567759cd4429d879d67a3ac8f5bb91790489d2 Mon Sep 17 00:00:00 2001 From: mxcl Date: Fri, 8 Jul 2022 21:31:19 -0400 Subject: [PATCH] Stacktrace this error --- README.md | 10 +++++----- src/hooks/useInventory.ts | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f3ffcb97..214561e4 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Change how your team works.   -# tea/cli 0.3.3 +# tea/cli 0.3.4 tea is a universal virtual‑environment manager: @@ -525,10 +525,10 @@ If you got this error message, you need to install tea: ## Dependencies -| Project | Version | Lock | -|-------------|---------|--------| -| deno.land | ^1.18 | 1.20.3 | -| tea.xyz | ^0 | 0.3.3 | +| Project | Version | +|-------------|---------| +| deno.land | ^1.18 | +| tea.xyz | ^0 | [pantry]: ../../../../pantry diff --git a/src/hooks/useInventory.ts b/src/hooks/useInventory.ts index ab392f7c..13aee760 100644 --- a/src/hooks/useInventory.ts +++ b/src/hooks/useInventory.ts @@ -15,9 +15,10 @@ export interface Inventory { export default function useInventory(): Response { const getVersions = async ({ project, constraint }: PackageRequirement) => { const { platform, arch } = usePlatform() - const rsp = await fetch(`https://s3.amazonaws.com/dist.tea.xyz/${project}/${platform}/${arch}/versions.txt`) + const url = `https://s3.amazonaws.com/dist.tea.xyz/${project}/${platform}/${arch}/versions.txt` + const rsp = await fetch(url) - if (!rsp.ok) throw "404-not-found" //TODO + if (!rsp.ok) throw new Error(`404-not-found: ${url}`) //FIXME const releases = await rsp.text()