class MediaWiki::APIError

Wrapper for errors returned by MediaWiki API. Possible codes are defined in www.mediawiki.org/wiki/API:Errors_and_warnings.

Warnings also throw errors with code 'warning', unless MediaWiki::Gateway#new was called with :ignorewarnings.

Attributes

code[R]
info[R]
message[R]

Public Class Methods

new(code, info) click to toggle source
# File lib/media_wiki/exception.rb, line 14
def initialize(code, info)
  @code, @info, @message = code, info,
    "API error: code '#{code}', info '#{info}'"
end

Public Instance Methods

to_s() click to toggle source
# File lib/media_wiki/exception.rb, line 19
def to_s
  "#{self.class}: #{@message}"
end