class Tkrzw::Status

Status of operations.

Constants

APPLICATION_ERROR

Generic error caused by the application logic.

BROKEN_DATA_ERROR

Error that internal data are broken.

CANCELED_ERROR

Error that the operation is canceled.

DUPLICATION_ERROR

Error that a specific resource is duplicated.

INFEASIBLE_ERROR

Error that the operation is infeasible.

INVALID_ARGUMENT_ERROR

Error that a given argument is invalid.

NETWORK_ERROR

Error caused by networking failure.

NOT_FOUND_ERROR

Error that a specific resource is not found.

NOT_IMPLEMENTED_ERROR

Error that the feature is not implemented.

PERMISSION_ERROR

Error that the operation is not permitted.

PRECONDITION_ERROR

Error that a precondition is not met.

SUCCESS

Success.

SYSTEM_ERROR

Generic error from underlying systems.

UNKNOWN_ERROR

Generic error whose cause is unknown.

Public Class Methods

code_name(code) click to toggle source

Gets the string name of a status code.

  • @param code The status code.

  • @return The name of the status code.

# File tkrzw.rb, line 191
def self.code_name(code)
  # (native code)
end
new(code=SUCCESS, message="") click to toggle source

Sets the code and the message.

  • @param code The status code. This can be omitted and then SUCCESS is set.

  • @param message An arbitrary status message. This can be omitted and the an empty string is set.

# File tkrzw.rb, line 115
def initialize(code=SUCCESS, message="")
  # (native code)
end

Public Instance Methods

!=(rhs) click to toggle source

Returns True if the other object doesn't have the same code.

  • @param rhs The object to compare. It can be a status or an integer.

  • @return False if they are the same, or True if they are not.

# File tkrzw.rb, line 184
def !=(rhs)
  # (native code)
end
==(rhs) click to toggle source

Returns True if the other object has the same code.

  • @param rhs The object to compare. It can be a status or an integer.

  • @return True if they are the same, or False if they are not.

# File tkrzw.rb, line 177
def ==(rhs)
  # (native code)
end
code() click to toggle source

Gets the status code.

  • @return The status code.

# File tkrzw.rb, line 134
def code()
  # (native code)
end
inspect() click to toggle source

Returns a string representation of the object.

  • @return The string representation of the object.

# File tkrzw.rb, line 170
def inspect()
  # (native code)
end
join(rht) click to toggle source

Assigns the internal state from another status object only if the current state is success.

  • @param rhs The status object.

# File tkrzw.rb, line 128
def join(rht)
  # (native code)
end
message() click to toggle source

Gets the status message.

  • @return The status message.

# File tkrzw.rb, line 140
def message()
  # (native code)
end
ok?() click to toggle source

Returns true if the status is success.

  • @return True if the status is success, or False on failure.

# File tkrzw.rb, line 146
def ok?()
  # (native code)
end
or_die() click to toggle source

Raises an exception if the status is not success.

# File tkrzw.rb, line 152
def or_die()
  # (native code)
end
set(code=SUCCESS, message="") click to toggle source

Sets the code and the message.

  • @param code The status code. This can be omitted and then SUCCESS is set.

  • @param message An arbitrary status message. This can be omitted and the an empty string is set.

# File tkrzw.rb, line 122
def set(code=SUCCESS, message="")
  # (native code)
end
to_i() click to toggle source

Returns the status code.

  • @return The status code.

# File tkrzw.rb, line 164
def to_i()
  # (native code)
end
to_s() click to toggle source

Returns a string representation of the content.

  • @return The string representation of the content.

# File tkrzw.rb, line 158
def to_s()
  # (native code)
end