Module: Ftpd::Error

Included in:
CommandSequenceChecker, FileSystemErrorTranslator, Session
Defined in:
lib/ftpd/error.rb

Instance Method Summary collapse

Instance Method Details

#error(message) ⇒ Object

Raises:



4
5
6
# File 'lib/ftpd/error.rb', line 4

def error(message)
  raise CommandError, message
end

#permanent_error(message) ⇒ Object



24
25
26
# File 'lib/ftpd/error.rb', line 24

def permanent_error(message)
  error "550 #{message}"
end

#sequence_errorObject



20
21
22
# File 'lib/ftpd/error.rb', line 20

def sequence_error
  error "503 Bad sequence of commands"
end

#transient_error(message) ⇒ Object



8
9
10
# File 'lib/ftpd/error.rb', line 8

def transient_error(message)
  error "450 #{message}"
end

#unimplemented_errorObject



16
17
18
# File 'lib/ftpd/error.rb', line 16

def unimplemented_error
  error "502 Command not implemented"
end

#unrecognized_error(s) ⇒ Object



12
13
14
# File 'lib/ftpd/error.rb', line 12

def unrecognized_error(s)
  error "500 Syntax error, command unrecognized: #{s.chomp}"
end