Exception: Vips::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/vips/error.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.



7
8
9
10
11
12
13
14
15
16
# File 'lib/vips/error.rb', line 7

def initialize(msg = nil)
    if msg
        @details = msg
    elsif Vips::error_buffer != ""
        @details = Vips::error_buffer
        Vips::error_clear
    else 
        @details = nil
    end
end

Instance Method Details

#to_sString

Pretty-print a Vips::Error.

Returns:

  • (String)

    The error message



21
22
23
24
25
26
27
# File 'lib/vips/error.rb', line 21

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