module Strutta # Strutta Wrapper Errors module Errors # Game ID is required for .get, .update, .delete GAME_ID_REQUIRED = 'Game ID required' # Round ID is required for .get, .update, .delete ROUND_ID_REQUIRED = 'Round ID required' # Participant ID is required for .get, .update, .delete PARTICIPANT_ID_REQUIRED = 'Participant ID required' # Entry ID is required for .get, .update, .delete ENTRY_ID_REQUIRED = 'Entry ID required' # ID is not allowed for some methods OBJECT_NOT_ALLOWED = 'This method may not have an ID associated with it. Example: strutta.games.entries.all instead of strutta.games.entries(ENTRY_ID).all' # ID is not allowed for some methods INVALID_SEARCH = 'This version of the API only support searching by email' # Some http verbs are disabled for object, tell the user nicely METHOD_DISABLED = 'This method is disabled for this object type' # Generic Errors class Error < StandardError end # 400 Errors class BadRequestError < Error end # 401 Errors class Unauthorized < Error end # 404 Errors class ObjectNotFoundError < Error end # 422 Errors class UnprocessableEntityError < Error end # .get, .update, .delete requests require an object ID class ObjectIDRequired < Error end # .all, .create do not allow an abject ID class ObjectIDNotAllowed < Error end # Enforce searching only by email class InvalidSearchParameters < Error end # Enforce disabled endpoints class DisabledEndpointError < Error end end end