Class: Net::SFTP::StatusException

Class | Net::SFTP::StatusException
In: | lib/net/sftp/errors.rb lib/net/sftp/errors.rb
Parent: | Net::SFTP::Exception

A exception class for reporting a non-success result of an operation.

### Methods

message message new new

### Attributes

code | [R] | The error code (numeric)
code | [R] | The error code (numeric)
description | [R] | The description of the error
description | [R] | The description of the error
response | [R] | The response object that caused the exception.
response | [R] | The response object that caused the exception.
text | [R] | Any incident-specific text given when the exception was raised
text | [R] | Any incident-specific text given when the exception was raised

### Public Class methods

new(response, text=nil)

Create a new status exception that reports the given code and description.

[Source]

        # File lib/net/sftp/errors.rb, line 23
    23:     def initialize(response, text=nil)
    24:       @response, @text = response, text
    25:       @code = response.code
    26:       @description = response.message
    27:       @description = Response::MAP[@code] if @description.nil? || @description.empty?
    28:     end

new(response, text=nil)

Create a new status exception that reports the given code and description.

[Source]

        # File lib/net/sftp/errors.rb, line 23
    23:     def initialize(response, text=nil)
    24:       @response, @text = response, text
    25:       @code = response.code
    26:       @description = response.message
    27:       @description = Response::MAP[@code] if @description.nil? || @description.empty?
    28:     end

### Public Instance methods

message()

Override the default message format, to include the code and description.

[Source]

        # File lib/net/sftp/errors.rb, line 32
    32:     def message
    33:       m = super
    34:       m << " #{text}" if text
    35:       m << " (#{code}, #{description.inspect})"
    36:     end

message()

Override the default message format, to include the code and description.

[Source]

        # File lib/net/sftp/errors.rb, line 32
    32:     def message
    33:       m = super
    34:       m << " #{text}" if text
    35:       m << " (#{code}, #{description.inspect})"
    36:     end

[Validate]