We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fac77b0 commit 2abef82Copy full SHA for 2abef82
Service.gs
@@ -72,7 +72,7 @@ Service_.prototype.setTokenFormat = function(tokenFormat) {
72
};
73
74
/**
75
- * Sets the additional HTTP headers that should be sent when retrieving or
+ * Sets the additional HTTP headers that should be sent when retrieving or
76
* refreshing the access token.
77
* @param Object.<string,string> tokenHeaders A map of header names to values.
78
* @return {Service_} This service, for chaining.
@@ -282,7 +282,11 @@ Service_.prototype.hasAccess = function() {
282
var now = getTimeInSeconds_(new Date());
283
if (expires_time - now < Service_.EXPIRATION_BUFFER_SECONDS_) {
284
if (token.refresh_token) {
285
- this.refresh();
+ try {
286
+ this.refresh();
287
+ } catch (e) {
288
+ return false;
289
+ }
290
} else {
291
return false;
292
}
0 commit comments