lib/ernie.rb in ernie-0.3.4 vs lib/ernie.rb in ernie-0.3.5
- old
+ new
@@ -57,11 +57,11 @@
end
def self.dispatch(mod, fun, args)
xargs = deconvert(args)
self.log("-- " + [mod, fun, xargs].inspect)
- self.mods[mod] || raise(ServerError.new("No such module: '#{mod}'"))
+ self.mods[mod] || raise(ServerError.new("No such module '#{mod}'"))
self.mods[mod].funs[fun] || raise(ServerError.new("No such function '#{mod}:#{fun}'"))
res = self.mods[mod].funs[fun].call(*xargs)
convert(res)
end
@@ -75,15 +75,15 @@
res = self.dispatch(mod, fun, args)
xres = [:reply, res]
self.log("<- " + xres.inspect)
f.send!(xres)
rescue ServerError => e
- xres = [:error, [:server, 0, e.message, e.backtrace]]
+ xres = [:error, [:server, 0, e.class.to_s, e.message, e.backtrace]]
self.log("<- " + xres.inspect)
self.log(e.backtrace.join("\n"))
f.send!(xres)
rescue Object => e
- xres = [:error, [:user, 0, e.message, e.backtrace]]
+ xres = [:error, [:user, 0, e.class.to_s, e.message, e.backtrace]]
self.log("<- " + xres.inspect)
self.log(e.backtrace.join("\n"))
f.send!(xres)
end
f.receive_loop
\ No newline at end of file