Introduce custom errors for player handling
Custom errors for malformed/nonexistent player IDs as well as a player not having a high enough balance for the money requested. This will allow me to encode more information in the errors, for callers to use. I'm generally of the opinion that callers should be checking error conditions before calling these functions, but per Murphy's law it would be nice to have more information in the error message.
This commit is contained in:
@@ -55,6 +55,8 @@
|
||||
(:export
|
||||
:player
|
||||
:players
|
||||
:error-player-nonexistent
|
||||
:error-player-broke
|
||||
:player-id :player-balance :player-hand
|
||||
:player-exists? :player-bankrupt? :player-can-bet?
|
||||
:player-pay
|
||||
|
||||
Reference in New Issue
Block a user