Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is there any way to check api is unable to connect to github or internet not found #388

Closed
shanalikhan opened this issue Oct 10, 2016 · 2 comments

Comments

@shanalikhan
Copy link

Is there any way to check from github api that its unable to connect to github and internet is not connected so when i initialize the api by this :

  GitHubApi = require("github");
        github = new GitHubApi({
            version: "3.0.0"
        });

it should tell by exception that unable to connect to github or internet not connected to allow me to stop using other operations of this API

@clayreimann
Copy link
Member

Determining network connectivity feels outside the scope of this package.

Have you looked at the errors that come back when you try to execute a request in such a case?

@shanalikhan
Copy link
Author

its the exception as

//Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:118 [Extension Host] Error: getaddrinfo ENOTFOUND api.github.com api.github.com:443
    at global.sendError (/Users/fronteed/.vscode/extensions/Shan.code-settings-sync-2.2.3/node_modules/github/lib/index.js:783:19)
    at /Users/fronteed/.vscode/extensions/Shan.code-settings-sync-2.2.3/node_modules/github/lib/index.js:792:29
    at callCallback (/Users/fronteed/.vscode/extensions/Shan.code-settings-sync-2.2.3/node_modules/github/lib/index.js:667:17)
    at ClientRequest.<anonymous> (/Users/fronteed/.vscode/extensions/Shan.code-settings-sync-2.2.3/node_modules/github/lib/index.js:739:17)
    at emitOne (events.js:90:13)
    at ClientRequest.emit (events.js:182:7)
    at TLSSocket.socketErrorListener (_http_client.js:295:9)
    at emitOne (events.js:90:13)
    at TLSSocket.emit (events.js:182:7)
    at connectErrorNT (net.js:996:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)(anonymous function) @ //Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:118 //Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:93 Error Logged In Console (Help menu > Toggle Developer Tools). You may open an issue using 'Sync : Open Issue' from advance setting command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants