Exception: RuneRb::System::Errors::ConflictingNameError

Inherits:
StandardError
  • Object
show all
Defined in:
app/system/errors.rb

Overview

Raised when a name conflict occurs.

Since:

  • 0.9.3

Instance Method Summary collapse

Constructor Details

#initialize(type, received) ⇒ ConflictingNameError

Returns a new instance of ConflictingNameError.

Since:

  • 0.9.3


20
21
22
23
24
25
26
# File 'app/system/errors.rb', line 20

def initialize(type, received)
  case type
  when :banned_name then super("Appended banned name already exists in database!\t[Received:] #{RuneRb::GLOBAL[:COLOR].red.bold(received)}")
  when :username then super("A profile with this Username already exists in database!\t[Received:] #{RuneRb::GLOBAL[:COLOR]::red.bold(received)}")
  else super("Unspecified ConflictingNameError! [Type: #{type.inspect}][Rec: #{RuneRb::GLOBAL[:COLOR].red.bold(received)}]")
  end
end