Exception: Rubirai::MiraiError

Inherits:
RubiraiError show all
Defined in:
lib/rubirai/errors.rb

Overview

Mirai error

Instance Method Summary collapse

Constructor Details

#initialize(code, msg = nil) ⇒ MiraiError

Returns a new instance of MiraiError.

Raises:



19
20
21
22
23
24
# File 'lib/rubirai/errors.rb', line 19

def initialize(code, msg = nil)
  raise(RubiraiError, 'invalid mirai error code') unless Rubirai::RETURN_CODE.key? code
  str = +"Mirai error: #{code} - #{Rubirai::RETURN_CODE[code]}"
  str << "\n#{msg}" if msg
  super str
end