Sha256: 3f2177026a596a2236e5e2d5e8d6dd9d1783c74cefe3b9032b389f08110f7680
Contents?: true
Size: 585 Bytes
Versions: 24
Compression:
Stored size: 585 Bytes
Contents
module Ftpd # Translate specific exceptions to FileSystemError. # # This is not intended to be used directly, but via the # TranslateExceptions module. class ExceptionTranslator def initialize @exceptions = [] end # Register an exception class. def register_exception(e) @exceptions << e end # Run a block, translating specific exceptions to FileSystemError. def translate_exceptions begin return yield rescue *@exceptions => e raise PermanentFileSystemError, e.message end end end end
Version data entries
24 entries across 24 versions & 2 rubygems