summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidAccessTokenException.java
blob: 95851fc1d2190b8a8c61a8ac553ef2d6d7c4a4f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.mapbox.mapboxsdk.exceptions;

import android.content.Context;
import android.os.Bundle;

import com.mapbox.mapboxsdk.maps.MapView;

/**
 * A {@code InvalidAccessTokenException} is thrown by {@link com.mapbox.mapboxsdk.maps.MapboxMap}
 * when there is either no access token set before {@link MapView#onCreate(Bundle)} or an invalid access token
 * is set in {@link com.mapbox.mapboxsdk.Mapbox#getInstance(Context, String)}
 *
 * @see MapView#onCreate(Bundle)
 * @see com.mapbox.mapboxsdk.Mapbox#getInstance(Context, String)
 */
public class InvalidAccessTokenException extends RuntimeException {

  public InvalidAccessTokenException() {
    super("\nUsing MapView requires setting a valid access token. Use Mapbox.getInstance(Context context, "
      + "String accessToken) to provide one. "
      + "\nPlease see https://www.mapbox.com/help/create-api-access-token/ to learn how to create one."
      + "\nMore information in this guide https://www.mapbox.com/help/first-steps-android-sdk/#access-tokens.");
  }
}