nonoroazoro / vscode-syncing

:zap: VSCode Extension - Sync all of your VSCode settings across multiple devices.
https://marketplace.visualstudio.com/items?itemName=nonoroazoro.syncing
Other
491 stars 30 forks source link

upload failed. Please check your internet connection. #1

Closed fengcen closed 7 years ago

fengcen commented 7 years ago

My network is ok. I try uploading with/without proxy. It always complains this problem. Another extension shanalikhan/code-settings-sync works fine.

nonoroazoro commented 7 years ago

@fengcen Sorry about that.

  1. Could you please help to check if there's any relevant log in Developer Tools (via Menu -> Help -> Developer Tools) when the problem occur.

  2. Also I need your vsocde version and OS version.

  3. And then, if possible, May I check your proxy settings.

P.S. I'll add a simple logging system in the next release. Sorry for the inconvenience.

fengcen commented 7 years ago

@nonoroazoro vscode version: 1.8.1

I debug the extension and found the error:

{"message":"Invalid request.\n\nFor 'properties/content', nil is not a string.","documentation_url":"https://developer.github.com/v3/gists/#create-a-gist"}

File: src/utils/Gist.js

Code:

/**
     * create gist.
     * @param {Object} p_json gist content.
     * @returns {Promise}
     */
    create(p_json) {
        return new Promise((p_resolve, p_reject) => {
            this._api.gists.create(p_json).then((gist) => {
                p_resolve(gist);
            }).catch((err) => {
                if (err.code === 401) {
                    const error = new Error("Please check your GitHub access token.");
                    error.code = err.code;
                    p_reject(error);
                } else {
                    console.error(err);
                    p_reject(new Error("Please check your Internet connection."));
                }
            });
        });
    }
nonoroazoro commented 7 years ago

@fengcen Thanks! I find out that it's an error from node-github's api, I'll solve the bug in the next update.

nonoroazoro commented 7 years ago

@fengcen I've fixed and updated the extension, please check, Thanks! 😸

fengcen commented 7 years ago

@nonoroazoro It works. Thank you.