12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- 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<T> : MissingSettingException
- {
- public MissingSettingException(Expression<Func<T, object?>> 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")
- {
- }
- }
- }
|