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

Better error handling #35

Open
zaaack opened this issue Mar 9, 2019 · 1 comment
Open

Better error handling #35

zaaack opened this issue Mar 9, 2019 · 1 comment

Comments

@zaaack
Copy link

zaaack commented Mar 9, 2019

TypeError: Cannot read property 'headers' of undefined
at Bar.request (/c/Users/z/Projects/turtle/node_modules/dripjs/dist/modules/exchanges/crypto/bitmex/rest/internal/rest.js:57:65)
at process._tickCallback (internal/process/next_tick.js:68:7)

 try {
            const response = await axios_1.default(url, request);
            const ratelimit = common_1.getRateLimit(response.headers);
            this.remaining = ratelimit.remaining;
            return {
                ratelimit,
                body: response.data,
            };
        }
        catch (error) {
+          console.error(error)
            return {
                ratelimit: common_1.getRateLimit(errro.response.headers),
                body: {},
                error: error.response.data.error,
            };
        }
@zlq4863947
Copy link
Member

Error handling is still in TODO, I'll do it later

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