Exception types - Pyosch/powertac-server GitHub Wiki

up
On this page, we list the exceptional conditions that may be detected by various server elements and that may somehow need to propagate across plugin boundaries as well as between the server and broker.

For each exception type, at least four critical pieces of information must be provided:

  1. Where does this exception get raised?
  2. Why is this exception raised?
  3. Where is this exception handled?
  4. What is supposed to happen when this exception is handled.

For each exception type, we must have a clear justification for using an exception rather than a simple error log entry. If the handler is going to do nothing other than write an error message to the log, then that should be done at the point when the exception is raised instead, and no exception should be used.

###ShoutCreationException Raised in Auctioneer plugins.

Because unsupported order type, or failure to save a new Shout.

Handled by unknown

Handling outcome unknown

Resolution This should not be an exception. It should result in a "rejected-command" message sent back to the Broker, with the offending message encapsulated in the returned message.

###ShoutDeletionException Raised in Auctioneer plugins.

Because Shout to be deleted does not exist.

Handled by unknown

Handling outcome unknown

###ShoutUpdateException Raised in Auctioneer plugins.

Because Shout to be updated does not exist, or database save failure.

Handled by unknown

Handling outcome unknown

Question Do we really update existing shouts? What is the use case?

###TariffException Raised unknown

Because unknown

Handled by unknown

Handling outcome unknown

Resolution This should not be an exception. It should result in a "rejected-command" message sent back to the Broker, with the offending message encapsulated in the returned message.

###MarketClearingException Raised in Auctioneer plugins.

Because internal failures

Handled by unknown

Handling outcome unknown

Resolution: It seems there is no obvious candidate to catch such an exception. Unless one can be found, then this should be replaced by an error log entry, and if necessary, a server shutdown.

###PositionUpdateException Raised in AccountingService

Because internal errors

Handled by unknown

Handling outcome unknown

Resolution: There is no obvious handler for this exception.

⚠️ **GitHub.com Fallback** ⚠️