Java SDK中的错误代码 [英] Error codes in Java SDK

查看:143
本文介绍了Java SDK中的错误代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有几千个错误代码列表:

There's a list of a few thousand error codes:

https://docs.microsoft.com/ en-us / bingads / guides / operation-error-codes?view = bingads-12

https://docs.microsoft.com/en-us/bingads/guides/operation-error-codes?view=bingads-12

此处还有用于处理异常的链接:

There's also this link for handling exceptions:

https ://docs.microsoft.com/en-us/bingads/guides/handle-service-errors-exceptions?view = bingads-12

https://docs.microsoft.com/en-us/bingads/guides/handle-service-errors-exceptions?view=bingads-12

但这些代码无法通过SDK获得。所以我目前有两个问题:

But those codes are not available through the SDK. So I currently have two problems:

1)当令牌因任何原因失败时,抛出OAuthTokenRequestException。但是,如何判断令牌是否属于此应用程序,或者用户是否无权访问所请求的资源,或者刷新令牌是否刚刚过期
且用户是否需要通过授权过程再次?

1) When a token fails for any reason then a OAuthTokenRequestException is thrown. But how can I tell whether the token doesn't belong to this application, or the user doesn't have access to the requested resource, or whether the refresh token just expired and the user needs to go through the authorization process again?

2)如果我们遇到超出通话费率的情况,我们如何检测它以便我们可以应用指数退避?

2) If we get to a situation where the call rate is exceeded, how can we detect it so we can apply an exponential back-off?

如果SDK实际暴露了SOAP错误代码,这两个问题都可以轻松解决。

Both problems could be easily solved if the SDK actually exposed the SOAP error codes.

谢谢

推荐答案

如果您观察到上述#1中提到的令牌例外,那么它与任何特定的Bing Ads服务操作无关。 HTTP跟踪应该显示带有一些细节的错误消息,如

本指南

$ b可以通过SDK访问$ b错误代码,例如,通过
BingAdsExceptionHelper
 (样本用法
here
)。当然帮助器是可选的,你可以直接捕获异常。

The error codes can be accessed via the SDK e.g., via BingAdsExceptionHelper (sample usage here). Of course the helper is optional and you can catch the exception directly.

我希望这有帮助,

Eric


这篇关于Java SDK中的错误代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆