cloudflare / logshare

logshare is a library & CLI client for retrieving logs from Cloudflare's Enterprise Log Share service.
https://support.cloudflare.com/hc/en-us/articles/216672448
BSD 3-Clause "New" or "Revised" License
80 stars 24 forks source link

Return error instead of HTTP response in GetFromTimestamp #23

Closed vanbroup closed 6 years ago

vanbroup commented 6 years ago

The function GetFromTimestamp does now return the error HTTP status 400: request failed on almost any error. It would be useful if this would return the error represented in the Cloudflare response instead.

Where my script that was pulling log files for ranges of 5 hours was running fine until yesterday, now it started to return an error HTTP status 400: request failed. The enterprise support was not helpful at all in this case. After replaying the request with curl we found out that the time limit was reduced significantly to 59 minutes as that included the following error message:

bad query: error parsing time: invalid time range: too long

elithrar commented 6 years ago

Addressing in https://github.com/cloudflare/logshare/pull/24

elithrar commented 6 years ago

@vanbroup - I've just tagged v1.4.2 (https://github.com/cloudflare/logshare/releases/tag/v1.4.2) which will incorporate this improvement. Thanks for raising.