2

The API has a Throttle on the number of requests you can make. So we queue our requests in a local database and make as many requests as possible until the "Throttle exception" is thrown. Upon catching we exit the program and a scheduled task starts the process over again in 15 minutes.

Is it standard to log this type of exception or just exit the program since this exception is expected

TacticalMin
  • 265
  • 2
  • 6

1 Answers1

6

I'd log (at info level) the reason I was exiting the program, though not the stack trace. I might log at debug level the details of the thrown exception, and configure debug logging off in production but on when in my IDE.

Having programs exit without obvious reason is just plain wrong. Your support team will curse you every time – or maybe start ignoring it when the program exits for some other reason, because they will assume that it is for the reason they know about.

And developers always want all the information – and know how to disable it if they don't care at the moment.

Bill Michell
  • 1,980
  • 14
  • 15