Module: Wowr::Exceptions
- Defined in:
- lib/wowr/exceptions.rb
Defined Under Namespace
Classes: ArenaTeamNameNotSet, ArenaTeamNotFound, CharacterBelowMinLevel, CharacterNameNotSet, CharacterNoInfo, CharacterNotFound, CookieNotSet, ElementNotFoundError, EmptyPage, EventNotSet, GuildBankNotFound, GuildNameNotSet, GuildNotFound, InvalidArenaTeamSize, InvalidIconSize, InvalidIconType, InvalidLoginDetails, InvalidSearchType, InvalidXML, ItemNotFound, LoginBroken, LoginRequiresAuthenticator, NetworkTimeout, NoSearchString, RealmNotSet, SearchError, ServerDoesNotExist
Class Method Summary collapse
Class Method Details
.raise_me(code, options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/wowr/exceptions.rb', line 3 def self.raise_me(code, = {}) case code when "noCharacter" raise CharacterNotFound.new("Character '#{[:character_name]}' not found.") when "belowMinLevel" raise CharacterBelowMinLevel.new("Character '#{[:character_name]}' is below min level (10).") else raise StandardError.new("The XML returned an error: #{code.to_s}") end end |