Skip to content

Commit

Permalink
Update URLs in help messages for access token documentation (#12451) …
Browse files Browse the repository at this point in the history
…(h/t @oritada)
  • Loading branch information
noritada committed Dec 8, 2022
1 parent 3436af5 commit 4aa43bd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/util/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class AJAXError extends Error {
url: string;
constructor(message: string, status: number, url: string) {
if (status === 401 && isMapboxHTTPURL(url)) {
message += ': you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes';
message += ': you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes';
}
super(message);
this.status = status;
Expand Down
2 changes: 1 addition & 1 deletion src/util/mapbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export class RequestManager {
}

_makeAPIURL(urlObject: UrlObject, accessToken: string | null | void): string {
const help = 'See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes';
const help = 'See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes';
const apiUrlObject = parseUrl(config.API_URL);
urlObject.protocol = apiUrlObject.protocol;
urlObject.authority = apiUrlObject.authority;
Expand Down
2 changes: 1 addition & 1 deletion test/unit/util/ajax.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ test('ajax', (t) => {
});
getJSON({url:'api.mapbox.com'}, (error) => {
t.equal(error.status, 401);
t.equal(error.message, "Unauthorized: you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes");
t.equal(error.message, "Unauthorized: you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes");
t.end();
});
window.server.respond();
Expand Down

0 comments on commit 4aa43bd

Please sign in to comment.