module ErrorHandling

Module handles all errors and messages to be raised by gem

Public Class Methods

raise_too_many_args_error() click to toggle source
# File lib/utils/error_handling.rb, line 4
def raise_too_many_args_error
  raise ArgumentError, 'Too many arguments given; search pokedex using either :id or :name'
end
undefined_endpoint(endpoint) click to toggle source
# File lib/utils/error_handling.rb, line 13
def undefined_endpoint(endpoint)
  msg = "Undefined endpoint; '#{endpoint}' not defined by https://pokeapi.co/"
  raise ArgumentError, msg
end
unnamed_resource_args() click to toggle source
# File lib/utils/error_handling.rb, line 8
def unnamed_resource_args
  msg = 'Too many arguments given; Only call get with a single symbol or a key-value pair'
  raise ArgumentError, msg
end