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

模板消息notice #21

Closed
zsj1029 opened this issue May 17, 2015 · 4 comments
Closed

模板消息notice #21

zsj1029 opened this issue May 17, 2015 · 4 comments

Comments

@zsj1029
Copy link

zsj1029 commented May 17, 2015

建议
将send的返回值,返回全部,不要只是msgid
{
"errcode":0,
"errmsg":"ok",
"msgid":200228332
}
回头方便调用者处理发送过程的结果(不是微信告知用户是否收到)

@overtrue
Copy link
Collaborator

@zsj1029 失败的话就是异常了 而不是 msgid

@overtrue
Copy link
Collaborator

@zsj1029 以下代码在请求的时候,如果发送失败就会异常了:

https://github.com/overtrue/wechat/blob/master/src/Wechat/Notice.php#L215-L217

@zsj1029
Copy link
Author

zsj1029 commented May 17, 2015

正常传递,基本不会失败对吧
代码处理了异常吗?
我要做个接口给其他系统发送信息用的
我意思假如发送失败,微信不会返回类似
{
"errcode":1,
"errmsg":"sorry sth is wrong"
}
我就把这部分错误信息直接返回给调用我接口的系统

@overtrue
Copy link
Collaborator

整个SDK 都是统一用异常形式报错的,你可以用try catch
或者全局定义一个错误处理,只捕获本SDK的

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