Fix passing Error object in remote

Closes #3089
This commit is contained in:
Cheng Zhao 2015-10-23 14:23:05 +08:00
parent 07adbc8e8a
commit d5c964c68c
2 changed files with 17 additions and 13 deletions

View file

@ -46,7 +46,8 @@ metaToValue = (meta) ->
when 'array' then (metaToValue(el) for el in meta.members)
when 'buffer' then new Buffer(meta.value)
when 'promise' then Promise.resolve(then: metaToValue(meta.then))
when 'error'
when 'error' then new Error(meta.message)
when 'exception'
throw new Error("#{meta.message}\n#{meta.stack}")
else
if meta.type is 'function'