Exception: TFTP::Error
- Inherits:
-
StandardError
- Object
- StandardError
- TFTP::Error
- Defined in:
- lib/tftp/error.rb
Overview
An exception raised by TFTP code.
Constant Summary collapse
- MESSAGES =
{ :invalid_block_num => "Block nums must begin with 1 and increase by one for each new block of data.", :no_filename_provided => "All RRQ/WRQ packets are required to have a filename.", :unsupported_mode => "Octet is the only mode currently supported." }
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message = nil) ⇒ Error
Returns a new instance of Error.
17 18 19 |
# File 'lib/tftp/error.rb', line 17 def initialize( = nil) super() end |
Class Method Details
.message(key, *args) ⇒ Object
11 12 13 14 |
# File 'lib/tftp/error.rb', line 11 def self.(key, *args) string = MESSAGES[key] or raise "[TFTP BUG] No error messages for #{key}" (args.empty? ? string : string % args).rstrip end |