class MPV::Error
Public Class Methods
error_to_string(error)
click to toggle source
# File lib/mpvlib/error.rb, line 35 def self.error_to_string(error) MPV.mpv_error_string(error) end
new(error, msg=nil)
click to toggle source
Calls superclass method
# File lib/mpvlib/error.rb, line 39 def initialize(error, msg=nil) super('MPV error: %s (%s): %s' % [ self.class.error_to_string(error), error, msg, ] ) end
raise_on_failure(msg=nil) { || ... }
click to toggle source
# File lib/mpvlib/error.rb, line 30 def self.raise_on_failure(msg=nil, &block) error = yield raise new(error, msg) if error && error < 0 end