⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exception_handler.rb

📁 Flex for rails的开发demo源码
💻 RB
字号:
require 'app/request_store'
require 'app/amf'
module RubyAMF
module Exceptions

#This class is used to take an RUBYAMFException and translate it into something that is useful when returned back to flash.
class ExceptionHandler
  include RubyAMF::App
  include RubyAMF::AMF
  
  def ExceptionHandler.HandleException(e, body)
    if RequestStore.amf_encoding == 'amf3'
      body.results = AS3Fault.new(e)
      #trigger RemoteObject failure for AsyncTokens
      if body.special_handling == "RemotingMessage"
        body.results["correlationId"] = body.get_meta('messageId')
        body.results["clientId"] = body.get_meta('clientId') || body.results.correlationId
      end
    else
      body.fail! #force the fail trigger for F8, this causes it to map to the onFault handler
      body.results = ASFault.new(e)
    end
  end
end
end
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -