Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a few misc errors #2092

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions iothub/service/src/Common/Exceptions/ErrorCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ public enum ErrorCode
ArgumentInvalid = 400004,

ArgumentNull = 400005,

/// <summary>
/// Returned by the service if a Json object provided by this library cannot be parsed. For instance, if the Json provided for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON (casing)

/// <see cref="RegistryManager.UpdateTwinAsync(string, Shared.Twin, string)"/> is invalid.
/// </summary>
IotHubFormatError = 400006,

/// <summary>
Expand Down Expand Up @@ -103,8 +108,6 @@ public enum ErrorCode
/// request or user input.
/// </para>
/// </summary>
//[Obsolete("This error does not appear to be returned by the service.")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing commented out code since this error is legitimate

//[EditorBrowsable(EditorBrowsableState.Never)]
BulkRegistryOperationFailure = 400013,

/// <summary>
Expand Down Expand Up @@ -170,7 +173,8 @@ public enum ErrorCode
// NotFound - 404

/// <summary>
/// The operation failed because the device cannot be found by IoT Hub. The device is either not registered or disabled.
/// The operation failed because the device cannot be found by IoT Hub. The device is either not registered or disabled. May be thrown by operations such as
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Casing style guidelines is to word this as "IoT hub" with a lowercase h.

/// <see cref="RegistryManager.GetDeviceAsync(string)"/>.
/// </summary>
DeviceNotFound = 404001,

Expand All @@ -189,6 +193,10 @@ public enum ErrorCode
[EditorBrowsable(EditorBrowsableState.Never)]
PartitionNotFound = 503003,

/// <summary>
/// The operation failed because the module cannot be found by IoT Hub. The module is either not registered or disabled. May be thrown by operations such as
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a concept of module registration at all?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you register modules to a device in your IoT Hub much the same way you register devices to your IoT Hub

/// <see cref="RegistryManager.GetModuleAsync(string, string)"/>.
/// </summary>
ModuleNotFound = 404010,

// Conflict - 409
Expand All @@ -198,6 +206,11 @@ public enum ErrorCode
/// </summary>
DeviceAlreadyExists = 409001,

/// <summary>
/// The operation failed because it attempted to add a module to a device when that device already has a module registered to it with the same Id. This issue can be
/// fixed by removing the existing module from the device first with <see cref="RegistryManager.RemoveModuleAsync(Module)"/>. This error code is only returned from
/// methods like <see cref="RegistryManager.AddModuleAsync(Module, System.Threading.CancellationToken)"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

End sentence with a period.

/// </summary>
ModuleAlreadyExistsOnDevice = 409301,

/// <summary>
Expand Down