Skip to content

Commit

Permalink
add content_policy_violation error handling on errorhandler class
Browse files Browse the repository at this point in the history
  • Loading branch information
fegloff committed Jul 10, 2024
1 parent b6d703d commit d78126f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export default {
explorerRestApiKey: process.env.EXPLORER_REST_API_KEY ?? '',
swapSubgraphApiUrl:
process.env.SWAP_SUBGRAPH_API_URL ??
'https://api.thegraph.com/subgraphs/name/nick8319/uniswap-v3-harmony'
'https://api.thegraph.com/subgraphs/name/nick8319/uniswap-v3-harmony' // 'https://api.thegraph.com/subgraphs/name/potvik/uniswap-v3-harmony'
},
walletConnect: { projectId: process.env.WALLET_CONNECT_PROJECT_ID ?? '' },
voiceTranslate: { isEnabled: Boolean(parseInt(process.env.BOT_VOICE_TRANSLATE_ENABLE ?? '0')) },
Expand Down
4 changes: 4 additions & 0 deletions src/modules/errorhandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ class ErrorHandler {
await sendMessage(ctx, e.message).catch(async (e) => { await this.onError(ctx, e, retryCount - 1, logger) })
ctx.transient.analytics.actualResponseTime = now()
onStop && await onStop(ctx)
} else if (e.code === 'content_policy_violation') {
await sendMessage(ctx, e.message).catch(async (e) => { await this.onError(ctx, e, retryCount - 1, logger) })
ctx.transient.analytics.actualResponseTime = now()
onStop && await onStop(ctx)
} else {
await sendMessage(
ctx,
Expand Down

0 comments on commit d78126f

Please sign in to comment.