cloudpathlib icon indicating copy to clipboard operation
cloudpathlib copied to clipboard

File not found error surfaces local path instead of cloud path

Open ejm714 opened this issue 4 years ago • 3 comments

I was loading a file from s3 and mistyped the file location. The error I got showed me the local tmp path, which was misleading. I think this should be the standard error you get when you try to do a cloud operation on a file that doesn't exist (something like "head object does not exist") or at least something that includes the cloud path instead of the local path.

DATA_DIR here is an S3Path.

Screen Shot 2021-02-05 at 3 33 22 PM

ejm714 avatar Feb 05 '21 23:02 ejm714

I agree with this - it's really hard to debug the issue when I get this error. In my case, I'm passing a cloud path to another library, and the error happens inside it - so it's hard to know how to resolve the problem.

Mchristos avatar Nov 02 '23 16:11 Mchristos

Thanks for the comment @Mchristos, unfortunately our library just can't know what other libraries try to do with our objects so there's not simple way to inject ourselves into these error messages. This is really another instance of #128, which has a complicated set of tradeoffs for the possible approaches.

Right now we're leaning towards the experimental work in #322 as the best approach, so I'd be curious if that works in your case.

pjbull avatar Nov 02 '23 16:11 pjbull