Exception: Rubirai::MiraiError
- Inherits:
-
RubiraiError
- Object
- RuntimeError
- RubiraiError
- Rubirai::MiraiError
- Defined in:
- lib/rubirai/errors.rb
Overview
Mirai error
Instance Method Summary collapse
-
#initialize(code, msg = nil) ⇒ MiraiError
constructor
A new instance of MiraiError.
Constructor Details
#initialize(code, msg = nil) ⇒ MiraiError
Returns a new instance of MiraiError.
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 |