lib/doraemon/proxy_server.rb in doraemon-1.0.8 vs lib/doraemon/proxy_server.rb in doraemon-1.0.9

- old
+ new

@@ -1,9 +1,11 @@ require 'ritm' require 'json' require 'cert' +$db = Hash.new() + module Doraemon class ProxyServer def initialize(port=8000, root) @@ -51,13 +53,13 @@ if _api_path begin _result = eval(File.read(_api_path)) if File.exist?(_api_path) - rescue + rescue Exception => e _result = { "code": -1, - "msg": "#{_req.path} 处理错误" + "msg": "#{_req.path} 处理错误: #{e.to_s}" } end _resp.status = 200 _resp.body = _result.to_json \ No newline at end of file