Exception: Ftpd::FtpServerError
- Inherits:
-
StandardError
- Object
- StandardError
- Ftpd::FtpServerError
- Defined in:
- lib/ftpd/exceptions.rb
Overview
Any error that send a reply to the client raises a FtpServerError. The message is the text to send (e.g. “Syntax error”) and the code is the FTP response code to send (e.g. “502”). This is typically not raised directly, but using the Error mixin.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(message, code) ⇒ FtpServerError
constructor
A new instance of FtpServerError.
- #message_with_code ⇒ Object
Constructor Details
#initialize(message, code) ⇒ FtpServerError
Returns a new instance of FtpServerError.
16 17 18 19 20 21 |
# File 'lib/ftpd/exceptions.rb', line 16 def initialize(, code) @code = code raise ArgumentError, "Invalid response code" unless valid_response_code? super() end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
14 15 16 |
# File 'lib/ftpd/exceptions.rb', line 14 def code @code end |
Instance Method Details
#message_with_code ⇒ Object
23 24 25 |
# File 'lib/ftpd/exceptions.rb', line 23 def "#{code} #{}" end |