dont carsh in API errors

Resolved 💬 1 comment Opened Apr 16, 2025 by chizkiyahu Closed Apr 16, 2025

when user have API error DONT carsh just print error and wait for user input

example error rate_limit_exceeded give the user the option to rerun in a minute

e [Error]: Rate limit reached for o4-mini in organization org-*** on tokens per min (TPM): Limit 200000, Used 143077, Requested 69194. Please try again in 3.681s. Visit https://platform.openai.com/account/rate-limits to learn more.
    at e.a [as iterator] (file:///opt/homebrew/lib/node_modules/@openai/codex/dist/cli.js:443:1514)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async I0.run (file:///opt/homebrew/lib/node_modules/@openai/codex/dist/cli.js:460:2356) {
  status: undefined,
  headers: undefined,
  request_id: undefined,
  error: {
    type: 'tokens',
    code: 'rate_limit_exceeded',
    message: 'Rate limit reached for o4-mini in organization org-***** on tokens per min (TPM): Limit 200000, Used 143077, Requested 69194. Please try again in 3.681s. Visit https://platform.openai.com/account/rate-limits to learn more.',
    param: null
  },
  code: 'rate_limit_exceeded',
  param: null,
  type: 'tokens'
}

Node.js v23.10.0

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗