Closed tyn1998 closed 1 year ago
Actually there is an error handler already:
I think the problem is that we should not regard "hypertrons.json NOT FOUND" as an error since only a few repos have this configuration file. Rather, we think it as another normal case.
/self-assign
I have tried:
But got:
It seems that octokit.request() catchs and handles fetch error so we cannot handle it ourselves. In another word, the red 404 error is inevitable if .github/hypertrons.json doesn't exist :(
I have read GitHub APIs and octokit APIs and found no API to check if a file exist. We must try to get a file to know if it exists.
Since everytime mainInject() runs, this.loadSettings() will try to get .github/hypertrons.json
, which is wasteful and unnecessary. Maybe we can refactor it with a strategy that can cache the file existence status to avoid requesting the file repeatedly.
I know how these errors occur when I was tackling this issue:
It is necessary to refactor this part of code, I think.
After v1.9.0, features related to hypertrons were removed, so for now hypercrx doesn't fetch .github/hypertrons.json
anymore.
This issue is closed.
Description
.github/hypertrons.json
is a configuration file for Hypercrx. But not all repo has this file (<10), so we get NOT_FOUND after requesting the file. Currently no error handling is involved, which might scare users happen to open devtools to see the console.And it pollutes the extension error page: