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

gowebdav library should not hush up errors #28

Closed
MrVine opened this issue Oct 22, 2018 · 6 comments
Closed

gowebdav library should not hush up errors #28

MrVine opened this issue Oct 22, 2018 · 6 comments
Assignees

Comments

@MrVine
Copy link
Collaborator

MrVine commented Oct 22, 2018

If we carefully see on following methods:

  • client.mkcol(), client.Mkdir(), client.MkdirAll()
  • client.copymove(), client.doCopyMove()
  • client.Write() and client.WriteStream()
  • it suppress real errors and returns only status code in the best case.

I propose to change this behaviour to allow user of our library to get original error message.

@MrVine
Copy link
Collaborator Author

MrVine commented Nov 3, 2018

@chripo, what do you think about?

@chripo chripo added enhancement and removed bug labels Nov 3, 2018
@chripo
Copy link
Member

chripo commented Nov 3, 2018

the lower case methods are not going to be exported.
therefore error handling / result handling by status code is simpler.
surely there is space for improvement and consistency, in uppercase methods too!
maybe we should introduce an own error structure that includes the status code, without or with the origin error.
simplicity first. ;)

@MrVine
Copy link
Collaborator Author

MrVine commented Nov 3, 2018

I have experience of using gowebdav with WebDav server which had outdated certificate, and it was difficult for me to answer the question "why my application does not recieves/sends data?", because all what I got back from gowebdav was:

Mkdir /path/to/my/file.txt 400

When I fix error suppressing and got this error:

x509: certificate signed by unknown authority

I understand where the problem is and fix it quickly.

That is why I propose to return error messages even from lower case methods.
Mkdir 400 it is not an good answer, users should knows how the real error sounds to be able to quickly fix it.

@chripo
Copy link
Member

chripo commented Nov 3, 2018 via email

@chripo
Copy link
Member

chripo commented Jan 27, 2022

We're going to fix this long outstanding issue due to @fischor and @zekroTJA investigations.
Thank you!

chripo added a commit that referenced this issue Jan 28, 2022
* bubble up request errors [#28]

* inhibit stream close on request

* add `StatusError`

* `PUT`: check if given target is a directory

* Revert "inhibit stream close on request"

Cherry-picked into branch dev-bodyclosing.

This reverts commit 2889239.

Co-authored-by: Christoph Polcin <[email protected]>
@chripo
Copy link
Member

chripo commented Jan 28, 2022

finally done.
thanks to @fischor and @zekroTJA

@chripo chripo closed this as completed Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants