diff --git a/src/utils/createOctokit.js b/src/utils/createOctokit.js index 368b7f9..9cfc1b6 100644 --- a/src/utils/createOctokit.js +++ b/src/utils/createOctokit.js @@ -20,5 +20,12 @@ export const createOctokit = () => { }; export const handleError = (error) => { - console.log("Error handler 123", error); + if (error.message === "Bad credentials") { + window.location.href = "/error"; + } else if ((error.message || "").indexOf("rate limit exceeded")) { + window.location.href = "/rate-limit-exceeded"; + } else { + window.location.href = "/error"; + console.log(error.message); + } };