Open vecerek opened 11 months ago
I get this with disabledChunked: false
in the case where the file in S3 is empty.
I think the issue is at https://github.com/Borewit/tokenizer-s3/blob/master/lib/s3-request.ts#L48-L56 S3 throws an error due to the invalid range.
@Borewit I'm happy to do a PR if I could get some guidance. I'm not sure what makes the best sense.
I was thinking of returning {}
on the catch, which would then be caught by https://github.com/Borewit/tokenizer-range/blob/master/lib/range-request-factory.ts#L56-L58 and at least throw a more meaningful error?
Hi @johnf , thanks for looking into this. The best error messages usually generated at the place they occur. Caught exceptions can possibly at a bit of more complicated context information but should certainly not replace the original error message.
What would do you think be a more meaningful error?
I think the requested range and the file length would be interesting to add to the error, which could help to nail down this issue.
Also, if you don't want to lose the original error, set the cause
property on the wrapping error: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause.
Sometimes I'm getting the following error:
at async makeTokenizer (/app/node_modules/@tokenizer/s3/lib/index.js:18:22)
points to this line. I'm not able to reproduce the error with a specific file. Once I can, I will update the issue.Versions used:
@tokenizer/s3
@smithy/smithy-client