Use try…catch
anywhere you use await
const client = HypothesisRestClient({ apiKey: YOUR_API_KEY })
try {
await client.annotations.createAnnotation(NEW_ANNOTATION)
} catch (ex) {
console.error(ex)
}
try {
await createAnnotation(apiKeyConnectionOptions, NEW_ANNOTATION)
} catch (ex) {
console.error(ex)
}
Generated using TypeDoc