/////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2016 - License: GNU GPLv3 // // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // // rights of fair usage, the disclaimer and warranty conditions. // /////////////////////////////////////////////////////////////////////////// // Originally based on: WebDAV .NET client by Sergey Kazantsev using System; using System.Runtime.Serialization; using System.Text; using System.Web; namespace wasDAVClient.Helpers { public class wasDAVException : HttpException { public wasDAVException() { } public wasDAVException(string message) : base(message) { } public wasDAVException(string message, int hr) : base(message, hr) { } public wasDAVException(string message, Exception innerException) : base(message, innerException) { } public wasDAVException(int httpCode, string message, Exception innerException) : base(httpCode, message, innerException) { } public wasDAVException(int httpCode, string message) : base(httpCode, message) { } public wasDAVException(int httpCode, string message, int hr) : base(httpCode, message, hr) { } protected wasDAVException(SerializationInfo info, StreamingContext context) : base(info, context) { } public override string ToString() { var sb = new StringBuilder(); sb.Append($"HttpStatusCode: {GetHttpCode()}"); sb.Append(Environment.NewLine); sb.Append($"ErrorCode: {ErrorCode}"); sb.Append(Environment.NewLine); sb.Append($"Message: {Message}"); sb.Append(Environment.NewLine); sb.Append(base.ToString()); return sb.ToString(); } } }