Skip to content

Commit

Permalink
Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
cultpodcasts committed Jul 21, 2024
1 parent 8a69222 commit 0b460a1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export default {
resp = Response.redirect(url.toString());
} else {
dataPoint.blobs!.push("Key not found");
console.log("Key not found");
const base64 = `${key}==`;
const uint8Array = new Uint8Array(Buffer.from(base64, "base64"));
const first4 = uint8Array.subarray(0, 4).reverse();
Expand Down Expand Up @@ -72,7 +71,14 @@ export default {
const url = new URL(`${item.podcastName}/${item.id}`, env.redirect);
dataPoint.blobs!.push(redirectPath);
resp = Response.redirect(url.toString());
} else {
if (!body.value)
console.log(`Body value failure. No value. json: '${body}'.`)
else
console.log(`Body value length failure. length!=1 is '${body.value.length}'. json: '${body}'.`)
}
} else {
console.log(`Failure invoking search-service. Status-code: '${result.status}'.`);
}
}
} catch (error) {
Expand Down

0 comments on commit 0b460a1

Please sign in to comment.