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.
14 15 16 17 18 19 |
# File 'lib/ftpd/exceptions.rb', line 14 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.
12 13 14 |
# File 'lib/ftpd/exceptions.rb', line 12 def code @code end |
Instance Method Details
#message_with_code ⇒ Object
21 22 23 |
# File 'lib/ftpd/exceptions.rb', line 21 def "#{code} #{}" end |