From db7689aa38e4394e4c9c6216fc6e8eab11ea0a4f Mon Sep 17 00:00:00 2001 From: timtay-microsoft Date: Fri, 9 Jul 2021 15:34:40 -0700 Subject: [PATCH] Obsolete error codes that are not throw by the service (#2079) --- .../src/Common/Exceptions/ErrorCode.cs | 77 ++++++++++++++++--- 1 file changed, 68 insertions(+), 9 deletions(-) diff --git a/iothub/service/src/Common/Exceptions/ErrorCode.cs b/iothub/service/src/Common/Exceptions/ErrorCode.cs index 619c781e59..e7a5d22150 100644 --- a/iothub/service/src/Common/Exceptions/ErrorCode.cs +++ b/iothub/service/src/Common/Exceptions/ErrorCode.cs @@ -17,27 +17,53 @@ public enum ErrorCode // BadRequest - 400 InvalidProtocolVersion = 400001, + /// + /// Unused error code. Service does not return it and neither does the SDK. + /// + [Obsolete("This error does not appear to be thrown by the service.")] + [EditorBrowsable(EditorBrowsableState.Never)] DeviceInvalidResultCount = 400002, + InvalidOperation = 400003, ArgumentInvalid = 400004, ArgumentNull = 400005, IotHubFormatError = 400006, + + /// + /// Unused error code. Service does not return it and neither does the SDK. + /// + [Obsolete("This error does not appear to be thrown by the service.")] + [EditorBrowsable(EditorBrowsableState.Never)] DeviceStorageEntitySerializationError = 400007, /// - /// An error was encountered validating the storage blob container URI. + /// Unused error code. Service does not return it and neither does the SDK. /// - /// - /// As this error is in the 4xx HTTP status code range, the service would have detected a problem with the blob container - /// URI, such as does not exist, insufficient permissions, or SAS token expiry exceeded. - /// - [Obsolete("This error does not appear to be returned by the service.")] + [Obsolete("This error does not appear to be thrown by the service.")] [EditorBrowsable(EditorBrowsableState.Never)] BlobContainerValidationError = 400008, + /// + /// Unused error code. Service does not return it and neither does the SDK. + /// + [Obsolete("This error does not appear to be thrown by the service.")] + [EditorBrowsable(EditorBrowsableState.Never)] ImportWarningExistsError = 400009, + + /// + /// Unused error code. Service does not return it and neither does the SDK. + /// + [Obsolete("This error does not appear to be thrown by the service.")] + [EditorBrowsable(EditorBrowsableState.Never)] InvalidSchemaVersion = 400010, + DeviceDefinedMultipleTimes = 400011, + + /// + /// Unused error code. Service does not return it and neither does the SDK. + /// + [Obsolete("This error does not appear to be thrown by the service.")] + [EditorBrowsable(EditorBrowsableState.Never)] DeserializationError = 400012, /// @@ -51,20 +77,36 @@ public enum ErrorCode //[EditorBrowsable(EditorBrowsableState.Never)] BulkRegistryOperationFailure = 400013, + /// + /// Unused error code. Service does not return it and neither does the SDK. + /// + [Obsolete("This error does not appear to be returned by the service.")] + [EditorBrowsable(EditorBrowsableState.Never)] CannotRegisterModuleToModule = 400301, // Unauthorized - 401 IotHubNotFound = 401001, - IotHubUnauthorizedAccess = 401002, - /// /// The SAS token has expired or IoT hub couldn't authenticate the authentication header, rule, or key. /// For detailed information, see . /// + IotHubUnauthorizedAccess = 401002, + + /// + /// Unused error code. Service does not return it and neither does the SDK. Replaced by + /// + [Obsolete("This error does not appear to be thrown by the service.")] + [EditorBrowsable(EditorBrowsableState.Never)] IotHubUnauthorized = 401003, // Forbidden - 403 + + /// + /// Unused error code. Service does not return it and neither does the SDK. + /// + [Obsolete("This error does not appear to be thrown by the service.")] + [EditorBrowsable(EditorBrowsableState.Never)] IotHubSuspended = 403001, /// @@ -73,7 +115,7 @@ public enum ErrorCode IotHubQuotaExceeded = 403002, /// - /// The IoT Hub has exceeded the available quota for active jobs. + /// Unused error code. Service does not return it and neither does the SDK. /// [Obsolete("This error does not appear to be returned by the service.")] [EditorBrowsable(EditorBrowsableState.Never)] @@ -86,6 +128,11 @@ public enum ErrorCode /// DeviceMaximumQueueDepthExceeded = 403004, + /// + /// Unused error code. Service does not return it and neither does the SDK. + /// + [Obsolete("This error does not appear to be thrown by the service.")] + [EditorBrowsable(EditorBrowsableState.Never)] IotHubMaxCbsTokenExceeded = 403005, // NotFound - 404 @@ -95,7 +142,13 @@ public enum ErrorCode /// DeviceNotFound = 404001, + /// + /// Unused error code. Service does not return it and neither does the SDK. + /// + [Obsolete("This error does not appear to be thrown by the service.")] + [EditorBrowsable(EditorBrowsableState.Never)] JobNotFound = 404002, + PartitionNotFound = 404003, ModuleNotFound = 404010, @@ -133,6 +186,12 @@ public enum ErrorCode ThrottlingException = 429001, ThrottleBacklogLimitExceeded = 429002, + + /// + /// Unused error code. Service does not return it and neither does the SDK. + /// + [Obsolete("This error does not appear to be thrown by the service.")] + [EditorBrowsable(EditorBrowsableState.Never)] InvalidThrottleParameter = 429003, // InternalServerError - 500