nodules / asker

http.request wrapper with gzip, request retries and http.Agent tuning
MIT License
93 stars 11 forks source link

Add timers to error data for custom usage #124

Closed vitkarpov closed 8 years ago

vitkarpov commented 8 years ago

There's timings string in the data field of error. It'd be convenient to have time field also to get total time as number, to use within log.

Maybe getCommonErrorData should be kinda:

Request.prototype.getCommonErrorData = function() {
    return {
        timers: this.getTimers(),
        timings: this.formatTimestamp(),
        url: this.getUrl(),
        requestId: this.options.requestId
    };
};

?

vitkarpov commented 8 years ago

@narqo

narqo commented 8 years ago

+ asker@1.1.0 — since now on errors contain time property with the data of timers.

vitkarpov commented 8 years ago

Thanks 👍