Exception: Vips::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/vips.rb

Overview

The ruby-vips error class.

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil) ⇒ Error

Returns a new instance of Error.

Parameters:

  • msg (String) (defaults to: nil)

    The error message. If this is not supplied, grab and clear the vips error buffer and use that.



548
549
550
551
552
553
554
555
556
557
# File 'lib/vips.rb', line 548

def initialize msg = nil
  if msg
    @details = msg
  elsif Vips::vips_error_buffer != ""
    @details = Vips::vips_error_buffer
    Vips::vips_error_clear
  else
    @details = nil
  end
end

Instance Method Details

#to_sString

Pretty-print a Vips::Error.

Returns:

  • (String)

    The error message



562
563
564
565
566
567
568
# File 'lib/vips.rb', line 562

def to_s
  if @details != nil
    @details
  else
    super.to_s
  end
end