Skip to content

Better error handling #35

@zaaack

Description

@zaaack

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,
            };
        }

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