PostExceptions.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace InABox.Core
  5. {
  6. namespace Postable
  7. {
  8. public class EmptyPostException : Exception
  9. {
  10. public EmptyPostException() { }
  11. }
  12. public class PostFailedMessageException : Exception
  13. {
  14. public PostFailedMessageException(string message): base(message) { }
  15. }
  16. public class MissingSettingsException : Exception
  17. {
  18. public Type PostableType { get; }
  19. public MissingSettingsException(Type postableType) : base($"No PostableSettings for ${postableType}")
  20. {
  21. PostableType = postableType;
  22. }
  23. }
  24. public class RepostedException : Exception
  25. {
  26. public RepostedException() : base("Cannot process an item twice.")
  27. {
  28. }
  29. }
  30. public class PostCancelledException : Exception
  31. {
  32. public PostCancelledException() : base("Processing cancelled")
  33. {
  34. }
  35. }
  36. }
  37. }