Why does the java sdk always print error messages and cannot capture the error

94 views
Skip to first unread message

xu leo

unread,
Aug 13, 2021, 10:40:31 AM8/13/21
to AdWords API and Google Ads API Forum
hi google team,
When I requested to create a campaign, if the token expired, the error message would be printed all the time, which caused my program memory to overflow. I cannot use the program [try catch] to catch errors.
How can I deal with similar problems?
tks

screenshot-20210813-183803.png

xu leo

unread,
Aug 16, 2021, 3:08:53 AM8/16/21
to AdWords API and Google Ads API Forum
Does anyone answer this question?
How can the error log printed by the SDK be captured by the program instead of just looking at the log information. And the log has been cyclically output, which will cause memory overflow

Google Ads API Forum Advisor

unread,
Aug 16, 2021, 7:09:51 AM8/16/21
to xuliang...@gmail.com, adwor...@googlegroups.com

Hi Xu,

Thanks for reaching out to us.

Upon checking the error log screenshot you’ve provided with us, it appears that you've encountered an invalid_grant error. Kindly note that the invalid_grant usually indicates an issue with the refresh token. That said, you’ll need to regenerate credentials and refresh tokens. You may refer here to this guide for the steps on how you can regenerate credentials and refresh tokens.

If you still continue to encounter issues with the said token, even after following the steps from the above guide, I would recommend that you reach out to the Google API Console Support team via this link instead.

Let us know if you have any further questions.

Regards,

Google Logo
Yasar
Google Ads API Team
 

 

ref:_00D1U1174p._5004Q2Lmwrj:ref

xu leo

unread,
Aug 16, 2021, 7:57:45 AM8/16/21
to AdWords API and Google Ads API Forum
thank you for your reply. 
I know that my token has expired. 
I mean, how can I get this error when the token has expired. 
Now as long as the token expires, this log will always be printed when requesting any interface (because the request will be repeated all the time), but I cannot catch the token expiration error through the code (try catch). Keeping output logs can easily cause my computer's memory to overflow.
Is there any way to solve it? 
thanks

Google Ads API Forum Advisor

unread,
Aug 17, 2021, 1:11:56 PM8/17/21
to xuliang...@gmail.com, adwor...@googlegroups.com
Hi Xu,

I work with Yasar and will assist you. You can join the https://github.com/googleads/google-ads-java/issues/169 if this is the same issue, otherwise please open another thread in that issue tracker. This forum deals only with the request and response that all client libraries send to the API.

Regards,

Google Logo
Aryeh Baker
Google Ads API Team
 


ref:_00D1U1174p._5004Q2Lmwrj:ref
Reply all
Reply to author
Forward
0 new messages