using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Text; namespace InABox.Core.Postable { public class PostException : Exception { public PostException() : base() { } public PostException(string message) : base(message) { } } public class EmptyPostException : PostException { public EmptyPostException() { } } public class PostFailedMessageException : PostException { public PostFailedMessageException(string message): base(message) { } } public class MissingSettingException : PostException { public Type SettingsType { get; } public string Setting { get; set; } public MissingSettingException(Type settingsType, string setting): base($"Missing setting '{setting}'") { SettingsType = settingsType; Setting = setting; } } public class MissingSettingException : MissingSettingException { public MissingSettingException(Expression> setting) : base(typeof(T), CoreUtils.GetFullPropertyName(setting, ".")) { } } public class MissingSettingsException : PostException { public Type PostableType { get; } public MissingSettingsException(Type postableType) : base($"No PostableSettings for ${postableType}") { PostableType = postableType; } } public class RepostedException : PostException { public RepostedException() : base("Cannot process an item twice.") { } } public class PostCancelledException : PostException { public PostCancelledException() : base("Processing cancelled") { } } }