Class: Groonga::Client::Response::Error

Inherits:
Base
  • Object
show all
Defined in:
lib/groonga/client/response/error.rb

Instance Attribute Summary

Attributes inherited from Base

#body, #command, #header, #raw, #trace_logs

Instance Method Summary collapse

Methods inherited from Base

#elapsed_time, #error_message, #initialize, parse, #return_code, #start_time, #status_code, #success?

Constructor Details

This class inherits a constructor from Groonga::Client::Response::Base

Instance Method Details

#fileString?

Returns The file name where the error is occurred.

Returns:

  • (String, nil)

    The file name where the error is occurred.

Since:

  • 0.5.9



46
47
48
49
50
51
52
53
54
# File 'lib/groonga/client/response/error.rb', line 46

def file
  if header.nil?
    nil
  elsif header_v1?
    header[5]
  else
    (header["error"] || {})["file"]
  end
end

#functionString?

Returns The function name where the error is occurred.

Returns:

  • (String, nil)

    The function name where the error is occurred.

Since:

  • 0.5.9



33
34
35
36
37
38
39
40
41
# File 'lib/groonga/client/response/error.rb', line 33

def function
  if header.nil?
    nil
  elsif header_v1?
    header[4]
  else
    (header["error"] || {})["function"]
  end
end

#lineString?

Returns The line where the error is occurred.

Returns:

  • (String, nil)

    The line where the error is occurred.

Since:

  • 0.5.9



59
60
61
62
63
64
65
66
67
# File 'lib/groonga/client/response/error.rb', line 59

def line
  if header.nil?
    nil
  elsif header_v1?
    header[5]
  else
    (header["error"] || {})["line"]
  end
end

#messageString?

Returns The error message of the error response.

Returns:

  • (String, nil)

    The error message of the error response.

Since:

  • 0.1.0



26
27
28
# File 'lib/groonga/client/response/error.rb', line 26

def message
  error_message
end