Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uploadFiles and downloadFile have different error handling logic. #56

Open
Yupeng-li opened this issue Jul 3, 2024 · 1 comment
Open
Labels
P2 Important issue.

Comments

@Yupeng-li
Copy link

Hi,

I noticed that in uploadFiles the http status code that is greater than or equal to 400 is handled internally and is thrown as an error. See code

But downloadFile doesn't do the same. See code.

Also, the Error thrown by uploadFiles has an untyped field result. It's useful, but since it's not typed and is optional, we have to type it by ourselves.

I think it's better that they are consistent and there is a dedicated type of Error for http error responses.

@birdofpreyru birdofpreyru added the P2 Important issue. label Jul 3, 2024
@birdofpreyru
Copy link
Owner

Yes, I agree. uploadFiles() got recently updated, because of #48 / PR #49, but I had not arrived to update downloadFile() in the similar way. Please, submit a PR if you need it and have capacity to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Important issue.
Projects
None yet
Development

No branches or pull requests

2 participants