DecaTec / Portable-WebDAV-Library

Moved to codeberg.org - https://codeberg.org/DecaTec/Portable-WebDAV-Library - The Portable WebDAV Library is a strongly typed, async WebDAV client library which is fully compliant to RFC 4918, RFC 4331 and "Additional WebDAV Collection Properties". It is implemented as .NETStandard 1.1 library in oder to be used on any platform supporting .NETStandard 1.1.
https://decatec.de
Microsoft Public License
46 stars 11 forks source link

Throws exception in case error response WebSession #56

Closed yartat closed 7 years ago

yartat commented 7 years ago

Currently WebSession returns Task<bool> and caller must check result. I suggest throw exception in case error response from WebDAV. To capability with existing code I added parameter throwException with default value is false. So, all existing code will produce with old expected behavior, and new code can choose uses exceptions or checks result.

DecaTec commented 7 years ago

Any reason why you removed the async from the overloads and only the overloads "doing the job" keep the async keyword?

yartat commented 7 years ago

Thanks for response. I removed async because it not necessary. "Doing the job" has been already returned result as Task<bool>.

DecaTec commented 7 years ago

OK, maybe we should give `WebDavClient the same async treatment.

But honestly, I don't like the additional parameter on every method of WebDavSession. Another way of doing this would be to add a property to WebDavSession to enable/disable the throwing of exceptions.

yartat commented 7 years ago

It have a sense. I'll fix it

yartat commented 7 years ago

Please, check my commit

DecaTec commented 7 years ago

I've seen that you target net46 and netstandard2.0 Do we use any features of .NET Standard 2.0? Otherwise I'll leave the target to .NET Standard 1.1.

Even when used on a .NET Standard 2.0 project, the .NET Standard 1.1 version of the library will work.

See, I don't see any advantages of targeting .NET Standard 12.0, what do you think?

yartat commented 7 years ago

Thanks for response. All libraries from .NET Std 1.x work fine in .NET Std 2.0, so, targeting to 2.0 should remove :)

yartat commented 7 years ago

Looks fine

DecaTec commented 7 years ago

OK, merged.

Thanks for the contribution!

DecaTec commented 7 years ago

Updated NuGet package and online documentation.