Class AuthorizationException

AuthorizationException

An error that can be returned to trigger an authorization card to be shown to the user.


 CardService.newAuthorizationException()
   .setAuthorizationUrl("http://auth.com/")
   .setResourceDisplayName("Example Resource")
   .throwException();
 

Methods

MethodReturn typeBrief description
printJson()StringPrints the JSON representation of this object.
setAuthorizationUrl(authUrl)AuthorizationExceptionSets the authorization URL that user is taken to from the authorization prompt.
setCustomUiCallback(callback)AuthorizationExceptionThe name of a function to call to generate a custom authorization prompt.
setResourceDisplayName(name)AuthorizationExceptionSets the name that is displayed to the user when asking for authorization.
throwException()voidTriggers this exception to be thrown.

Detailed documentation

printJson()

Prints the JSON representation of this object. This is for debugging only.

Return

String


setAuthorizationUrl(authUrl)

Sets the authorization URL that user is taken to from the authorization prompt. Required.

Parameters

NameTypeDescription
authUrlStringthe authorization URL to set.

Return

AuthorizationException — this object, for chaining.


setCustomUiCallback(callback)

The name of a function to call to generate a custom authorization prompt. Optional.

Parameters

NameTypeDescription
callbackStringthe name of the function that generates a custom authorization prompt.

Return

AuthorizationException — this object, for chaining.


setResourceDisplayName(name)

Sets the name that is displayed to the user when asking for authorization. Required.

Parameters

NameTypeDescription
nameStringthe display name.

Return

AuthorizationException — this object, for chaining.


throwException()

Triggers this exception to be thrown.

Send feedback about...

Apps Script
Apps Script