Skip to content

Commit

Permalink
Merge pull request #16312 from Nexus-Mods/429-rate-limit
Browse files Browse the repository at this point in the history
less generic error for limit rate breaches
  • Loading branch information
insomnious committed Sep 12, 2024
2 parents 2fa8445 + e9fcdef commit c9b744b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/util/message.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* disable-eslint */
import {
addNotification,
IDialogAction,
Expand Down Expand Up @@ -737,6 +738,13 @@ function prettifyHTTPError(err: HTTPError): IErrorRendered {
};

const func = {
'429': () => {
const errorRendered: IErrorRendered = {
wrap: true,
message: 'You have exceeded the daily or hourly rate limit. Visit "help.nexusmods.com" and search for "Rate limit" for more information. Please try again later.',
}
return errorRendered;
},
}[err.statusCode] || fallback;

return func();
Expand Down

0 comments on commit c9b744b

Please sign in to comment.