Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何优雅的处理错误? #47

Closed
lileilei opened this issue Aug 14, 2018 · 3 comments
Closed

如何优雅的处理错误? #47

lileilei opened this issue Aug 14, 2018 · 3 comments

Comments

@lileilei
Copy link

例:
router.get('/user', async ctx => { const {res, err} = await dubbo.service.demoProvider.getUserInfo(); ctx.body = res || err.message; });
node端调用rpc服务,service端抛出异常err信息带打印信息不是标准的json对象,不知道问题出在哪里?求指教!!

@hufeng
Copy link
Member

hufeng commented Aug 15, 2018

@lileilei hi阿磊, 不是标准的json对象是什么意思?给我一个小栗子看看,err现在是标准的err对象。

@lileilei
Copy link
Author

java:
f0a85f11-3280-2178-5288-43496aa96d7a

bff端:
c899d2b6-c1bf-e263-f376-aaf7eab4e64f

err 带打印信息,不是标准json对象

@hufeng
Copy link
Member

hufeng commented Aug 15, 2018

这不是dubbo2.js的处理,而是https://github.com/node-modules/hessian.js/blob/master/lib/object.js#L77 在hessian反序列化的时候序列化成一个err对象。

@hufeng hufeng closed this as completed Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants