-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
egg-onerror support jsonp #1330
Labels
Comments
如果是已知异常,就 try/catch 将错误信息设置到 ctx.body 上。 |
这样就和不用egg-onerror没什么区别了 |
onerror 主要用于未捕获异常的兜底处理。 |
我现在做法就是在ctx上加了throwError,可以设置是否记日志等,然后用egg-onerror来做汇总处理…… |
要用贯高说的单独一个中间件来做,确实也就解决了这个jsonp的问题,不过在根据相应内容做对应处理,是不是感觉和onerror重复 |
@beliefgp 这个算是解决了? |
jsonp的pr已经合并,已经对外放出相关api了,这个稍微改下就可以了,这个你们来改,还是我有空提个pr |
这个还搞么? |
@beliefgp 继续搞完? |
@fengmk2 额……千总……这两天我抽空改改 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
当egg-jsonp和egg-onerror共用时,当一个jsonp请求,抛出异常时,会由egg-onerror处理,这时就不会包上callback了
有个想法:
可行?可以的话,我提个pr
The text was updated successfully, but these errors were encountered: