The logic to fallback to sourcegraph.com does not work properly and adds a lot of complexity that affects the entire browser extension.
performRequest() may throw non-Error instances (the response object) depending on specific GraphQL response fields. The conditions for this are so complex that it is near impossible to know as a downstream consumer if a call may throw an Error (like RepoNotFoundError), throw _the response object_, or return the response object with null fields. Bugs from this are guaranteed and it makes proper error handling very difficult to verify.queryGraphQL() function should only throw if the request fails, it returns { data, errors } raw from GraphQLresolveRev() inspect the result and can throw specific errors.cc @sqs
cc @beyang I think this logic was to support one of your customers?
Agreed, customers have not been told to rely on this and it rarely works as expected anyway. Let鈥檚 remove it and bring it back later when it is going to work really well.
Most helpful comment
Agreed, customers have not been told to rely on this and it rarely works as expected anyway. Let鈥檚 remove it and bring it back later when it is going to work really well.