Sha256: dd548b505ec70481c7d0fe1a55d2fd8ef010110f1f4b861d536d46d9cf34bd51
Contents?: true
Size: 1.57 KB
Versions: 3
Compression:
Stored size: 1.57 KB
Contents
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
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
strutta-api-1.0.3.1 | lib/strutta-api/errors.rb |
strutta-api-1.0.2 | lib/strutta-api/errors.rb |
strutta-api-1.0.1 | lib/strutta-api/errors.rb |