Skip to content

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

Closed

Description

@shanalikhan

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

Activity

  1. clayreimann commented on Oct 11, 2016

    @clayreimann
    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?

  2. shanalikhan commented on Oct 11, 2016

    @shanalikhan
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions