MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / isHttpError

Function isHttpError

packages/backend/src/github.ts:96–101  ·  view source on GitHub ↗
(error: unknown, status: number)

Source from the content-addressed store, hash-verified

94}
95
96const isHttpError = (error: unknown, status: number): boolean => {
97 return error !== null
98 && typeof error === 'object'
99 && 'status' in error
100 && error.status === status;
101}
102
103export const createOctokitFromToken = async ({ token, url }: { token?: string, url?: string }): Promise<{ octokit: Octokit, isAuthenticated: boolean }> => {
104 const isGitHubCloud = url ? new URL(url).hostname === GITHUB_CLOUD_HOSTNAME : true;

Callers 3

getReposOwnedByUsersFunction · 0.70
getReposForOrgsFunction · 0.70
getReposFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected