diff --git a/src/Umbraco.Core/Collections/ObservableDictionary.cs b/src/Umbraco.Core/Collections/ObservableDictionary.cs index 359fefda48..8e49ccf1b5 100644 --- a/src/Umbraco.Core/Collections/ObservableDictionary.cs +++ b/src/Umbraco.Core/Collections/ObservableDictionary.cs @@ -242,6 +242,7 @@ namespace Umbraco.Core.Collections /// /// /// + [Obsolete("Throw an ArgumentException when trying to add a duplicate key instead.")] [Serializable] internal class DuplicateKeyException : Exception { diff --git a/src/Umbraco.Core/Exceptions/ArgumentNullOrEmptyException.cs b/src/Umbraco.Core/Exceptions/ArgumentNullOrEmptyException.cs index cf6cddd801..037d35d0ee 100644 --- a/src/Umbraco.Core/Exceptions/ArgumentNullOrEmptyException.cs +++ b/src/Umbraco.Core/Exceptions/ArgumentNullOrEmptyException.cs @@ -7,6 +7,7 @@ namespace Umbraco.Core.Exceptions /// The exception that is thrown when a null reference, or an empty argument, is passed to a method that does not accept it as a valid argument. /// /// + [Obsolete("Throw an ArgumentNullException when the parameter is null or an ArgumentException when its empty instead.")] [Serializable] public class ArgumentNullOrEmptyException : ArgumentNullException { diff --git a/src/Umbraco.Core/Exceptions/DataOperationException.cs b/src/Umbraco.Core/Exceptions/DataOperationException.cs index 904420e1cf..233f9ccf21 100644 --- a/src/Umbraco.Core/Exceptions/DataOperationException.cs +++ b/src/Umbraco.Core/Exceptions/DataOperationException.cs @@ -8,6 +8,7 @@ namespace Umbraco.Core.Exceptions /// /// /// + [Obsolete("Refactor the generic type to a concrete serializable type.")] [Serializable] internal class DataOperationException : Exception { diff --git a/src/Umbraco.Core/Exceptions/WontImplementException.cs b/src/Umbraco.Core/Exceptions/WontImplementException.cs index 3e2765c3c2..9ca320eeda 100644 --- a/src/Umbraco.Core/Exceptions/WontImplementException.cs +++ b/src/Umbraco.Core/Exceptions/WontImplementException.cs @@ -14,6 +14,7 @@ namespace Umbraco.Core.Exceptions /// /// [Serializable] + [Obsolete("If a method or operation is not, and will not be, implemented, it is invalid, so we should throw an InvalidOperationException instead.")] public class WontImplementException : NotImplementedException { /// diff --git a/src/Umbraco.Core/IO/FileSecurityException.cs b/src/Umbraco.Core/IO/FileSecurityException.cs index 1bebb6d391..8ce9ab34a5 100644 --- a/src/Umbraco.Core/IO/FileSecurityException.cs +++ b/src/Umbraco.Core/IO/FileSecurityException.cs @@ -7,6 +7,7 @@ namespace Umbraco.Core.IO /// The exception that is thrown when the caller does not have the required permission to access a file. /// /// + [Obsolete("Throw an UnauthorizedAccessException instead.")] [Serializable] public class FileSecurityException : Exception { diff --git a/src/Umbraco.Core/Persistence/EntityNotFoundException.cs b/src/Umbraco.Core/Persistence/EntityNotFoundException.cs index b8778f0975..1d075339c0 100644 --- a/src/Umbraco.Core/Persistence/EntityNotFoundException.cs +++ b/src/Umbraco.Core/Persistence/EntityNotFoundException.cs @@ -9,6 +9,7 @@ namespace Umbraco.Core.Persistence /// An exception used to indicate that an Umbraco entity could not be found. /// /// + [Obsolete("Instead of throwing an exception, return null or an HTTP 404 status code instead.")] [Serializable] public class EntityNotFoundException : Exception { diff --git a/src/Umbraco.Web/Install/InstallException.cs b/src/Umbraco.Web/Install/InstallException.cs index 7efcbdc769..dfa2bc461b 100644 --- a/src/Umbraco.Web/Install/InstallException.cs +++ b/src/Umbraco.Web/Install/InstallException.cs @@ -7,6 +7,7 @@ namespace Umbraco.Web.Install /// Used for steps to be able to return a JSON structure back to the UI. /// /// + [Obsolete("Refactor the view model into a concrete serializable type.")] [Serializable] internal class InstallException : Exception {