Module: GetYourRep::Errors
- Included in:
- Delegation, OfficeLocation, Representative
- Defined in:
- lib/get_your_rep/errors.rb
Overview
Custom Error handling classes and methods.
Defined Under Namespace
Classes: AddressError, CommandNotFoundError, GetYourRepTypeError
Instance Method Summary collapse
-
#address_type_error ⇒ Object
:nodoc:.
-
#command_not_found_error ⇒ Object
:nodoc:.
-
#not_a_del_error ⇒ Object
:nodoc:.
-
#not_a_rep_error ⇒ Object
:nodoc:.
-
#not_an_office_error ⇒ Object
:nodoc:.
-
#reps_not_found_error ⇒ Object
:nodoc:.
Instance Method Details
#address_type_error ⇒ Object
:nodoc:
61 62 63 64 65 |
# File 'lib/get_your_rep/errors.rb', line 61 def address_type_error # :nodoc: raise AddressError rescue AddressError => error puts error.invalid_address_type.bold.red end |
#command_not_found_error ⇒ Object
:nodoc:
67 68 69 70 71 |
# File 'lib/get_your_rep/errors.rb', line 67 def command_not_found_error # :nodoc: raise CommandNotFoundError rescue CommandNotFoundError => error puts error.command_not_found.bold.red end |
#not_a_del_error ⇒ Object
:nodoc:
49 50 51 52 53 |
# File 'lib/get_your_rep/errors.rb', line 49 def not_a_del_error # :nodoc: raise GetYourRepTypeError rescue GetYourRepTypeError => error puts error.not_a_delegation end |
#not_a_rep_error ⇒ Object
:nodoc:
55 56 57 58 59 |
# File 'lib/get_your_rep/errors.rb', line 55 def not_a_rep_error # :nodoc: raise GetYourRepTypeError rescue GetYourRepTypeError => error puts error.not_a_rep end |
#not_an_office_error ⇒ Object
:nodoc:
43 44 45 46 47 |
# File 'lib/get_your_rep/errors.rb', line 43 def not_an_office_error # :nodoc: raise GetYourRepTypeError rescue GetYourRepTypeError => error puts error.not_an_office end |
#reps_not_found_error ⇒ Object
:nodoc:
73 74 75 76 77 |
# File 'lib/get_your_rep/errors.rb', line 73 def reps_not_found_error # :nodoc: raise AddressError rescue AddressError => error puts error.reps_not_found.bold.red end |