Sha256: 2c80f3e80828579f8791ecf2d63f653e545c257a9264bd3757d7899addcd7115

Contents?: true

Size: 409 Bytes

Versions: 10

Compression:

Stored size: 409 Bytes

Contents

# encoding: utf-8

module Punchblock
  module Translator
    class Asterisk
      module AMIErrorConverter
        def self.convert
          yield
        rescue RubyAMI::Error => e
          case e.message
          when 'No such channel', /Channel (\S+) does not exist./
            raise ChannelGoneError, e.message
          else
            raise e
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
punchblock-2.2.2 lib/punchblock/translator/asterisk/ami_error_converter.rb
punchblock-2.2.1 lib/punchblock/translator/asterisk/ami_error_converter.rb
punchblock-2.2.0 lib/punchblock/translator/asterisk/ami_error_converter.rb
punchblock-2.1.1 lib/punchblock/translator/asterisk/ami_error_converter.rb
punchblock-2.1.0 lib/punchblock/translator/asterisk/ami_error_converter.rb
punchblock-2.0.2 lib/punchblock/translator/asterisk/ami_error_converter.rb
punchblock-2.0.1 lib/punchblock/translator/asterisk/ami_error_converter.rb
punchblock-2.0.0 lib/punchblock/translator/asterisk/ami_error_converter.rb
punchblock-2.0.0.beta2 lib/punchblock/translator/asterisk/ami_error_converter.rb
punchblock-2.0.0.beta1 lib/punchblock/translator/asterisk/ami_error_converter.rb