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

Version Path
ftpd-1.1.1 lib/ftpd/exception_translator.rb
ftpd-1.1.0 lib/ftpd/exception_translator.rb
investtools-ftpd-1.0.1 lib/ftpd/exception_translator.rb
ftpd-1.0.1 lib/ftpd/exception_translator.rb
ftpd-1.0.0 lib/ftpd/exception_translator.rb
ftpd-0.17.0 lib/ftpd/exception_translator.rb
ftpd-0.16.0 lib/ftpd/exception_translator.rb
ftpd-0.15.0 lib/ftpd/exception_translator.rb
ftpd-0.14.0 lib/ftpd/exception_translator.rb
ftpd-0.13.0 lib/ftpd/exception_translator.rb
ftpd-0.12.0 lib/ftpd/exception_translator.rb
ftpd-0.11.0 lib/ftpd/exception_translator.rb
ftpd-0.10.0 lib/ftpd/exception_translator.rb
ftpd-0.9.0 lib/ftpd/exception_translator.rb
ftpd-0.7.1 lib/ftpd/exception_translator.rb
ftpd-0.8.0 lib/ftpd/exception_translator.rb
ftpd-0.7.0 lib/ftpd/exception_translator.rb
ftpd-0.6.0 lib/ftpd/exception_translator.rb
ftpd-0.5.0 lib/ftpd/exception_translator.rb
ftpd-0.4.0 lib/ftpd/exception_translator.rb