Hello, thank this excellent module come to this world. Make much convenient!
I want to send error.message to Google Analytics and control flow in TypeScript, now I use this workaround:
// TypeScript control flow
try {
ow(!gameId || !gameTitle, ow.boolean.false)
} catch (error) {
gaAPI.send({
ec: 'linebot',
ea: `${gameTitle}/query/streams/error`,
el: JSON.stringify({
context: `!gameId || !gameTitle`,
errorMessage: error.message,
}),
})
await context.sendText(i18nAPI.t('error/internal'))
}
if (!gameId || !gameTitle) return
const response = await twitchAPI.getStreams({
gameId,
language: LanguageParam.zh,
})
How can I get rid of TryCatch? like
// TypeScript control flow
const error = ow.getError(!gameId || !gameTitle, ow.boolean.false)
if (error && (!gameId || !gameTitle)) {
gaAPI.send({
ec: 'linebot',
ea: `${gameTitle}/query/streams/error`,
el: JSON.stringify({
context: `!gameId || !gameTitle`,
errorMessage: error.message,
}),
})
await context.sendText(i18nAPI.t('error/internal'))
return
}
const response = await twitchAPI.getStreams({
gameId,
language: LanguageParam.zh,
})
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too