All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.bingads.OAuthTokenRequestException Maven / Gradle / Ivy

Go to download

The Bing Ads Java SDK is a library improving developer experience when working with the Bing Ads services by providing high-level access to features such as Bulk API, OAuth Authorization and SOAP API.

There is a newer version: 13.0.22.1
Show newest version
package com.microsoft.bingads;

/**
 * This exception is thrown if an error was returned from the Microsoft Account authorization server.
 * To resolve this exception you can first check the stack trace to see the error details, in case there is some action you can take to resolve the issue.
 * For example you might have specified an invalid client ID.
 */
public class OAuthTokenRequestException extends RuntimeException {
    
    private final OAuthErrorDetails details;
    
    /**
     * Initializes a new instance of the OAuthTokenRequestException with the specified error message and OAuth error details.
     *
     * @param message the error message returned by the client library
     * @param details the details of an error returned from the Microsoft Account authorization server
     */
    public OAuthTokenRequestException(String message, OAuthErrorDetails details) {
        super(message);
        
        this.details = details;
    }
    
    /**
     * Gets details of an error returned from the Microsoft Account authorization server.
     */
    public OAuthErrorDetails getDetails() {
        return details;
    }

    @Override
    public String toString() {
        return super.toString() + ". Details: " + details.getError() + " - " + details.getDescription();
    }        
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy