Class MusicBrainz::Error
In: musicbrainz.c  (CVS)
Parent: StandardError

Error class for MusicBrainz errors. Exceptions raised by the library are wrapped by this class. If you want to catch all MusicBrainz-related errors, for example, you could do something like this:

  begin
    # run query
    mb.query MusicBrainz::Query::GetStatus
  rescue MusicBrainz::Error => e
    # catch MusicBrainz exceptions
    $stderr.puts "MusicBrainz error: #{e}"
  rescue Exception => e
    # catch Ruby exceptions
    $stderr.puts "Ruby error: #{e}"
  end

Note that several methods — in particular, MusicBrainz::Client#select and MusicBrainz::Client#query — return false rather than raising an exception to indicate an error.

[Validate]