Skip to content

Commit

Permalink
Update help links (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospassos authored Sep 8, 2024
1 parent 62f4a8f commit 57a4d73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ export namespace Help {
switch (statusCode) {
case 401:
return 'The request was not authorized, most likely due to invalid credentials. '
+ 'For help, see https://croct.help/sdk/js/invalid-credentials';
+ 'For help, see https://croct.help/sdk/javascript/invalid-credentials';

case 403:
return 'The origin of the request is not allowed in your application settings. '
+ 'For help, see https://croct.help/sdk/js/cors';
+ 'For help, see https://croct.help/sdk/javascript/unauthorized-origin';

case 408:
return 'The request timed out. '
+ 'For help, see https://croct.help/sdk/js/timeout';
+ 'For help, see https://croct.help/sdk/javascript/request-timeout';

case 423:
return 'The application has exceeded the monthly active users (MAU) quota. '
+ 'For help, see https://croct.help/sdk/js/mau-exceeded';
+ 'For help, see https://croct.help/sdk/javascript/mau-exceeded';

default:
return undefined;
Expand Down
8 changes: 4 additions & 4 deletions test/help.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ describe('A function to provide help for errors', () => {
it.each<StatusCodeScenario>([
{
status: 401,
help: 'https://croct.help/sdk/js/invalid-credentials',
help: 'https://croct.help/sdk/javascript/invalid-credentials',
},
{
status: 403,
help: 'https://croct.help/sdk/js/cors',
help: 'https://croct.help/sdk/javascript/unauthorized-origin',
},
{
status: 408,
help: 'https://croct.help/sdk/js/timeout',
help: 'https://croct.help/sdk/javascript/request-timeout',
},
{
status: 423,
help: 'https://croct.help/sdk/js/mau-exceeded',
help: 'https://croct.help/sdk/javascript/mau-exceeded',
},
])('should provide help for status code %i', scenario => {
expect(Help.forStatusCode(scenario.status)).toContain(scenario.help);
Expand Down

0 comments on commit 57a4d73

Please sign in to comment.