Skip to content

[update] Enhancing error mapping#304

Open
mhatrevi wants to merge 2 commits intomainfrom
vmhatre/remove-generic-error
Open

[update] Enhancing error mapping#304
mhatrevi wants to merge 2 commits intomainfrom
vmhatre/remove-generic-error

Conversation

@mhatrevi
Copy link
Copy Markdown
Contributor

@mhatrevi mhatrevi commented Apr 3, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 3, 2026 19:32
@mhatrevi mhatrevi linked an issue Apr 3, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves error mapping behavior in the AZIHSM Rust SDK by routing more underlying failures through existing HsmError conversions and adding logging for unmapped/error-collapsing paths.

Changes:

  • Route HsmPartitionInner::reset() DDI failures through From<DdiError> for HsmError.
  • Add logging when collapsing errors in HsmErrorMapper::map_hsm_err and when converting unmapped DdiError values.
  • Change the error returned when DeviceCredKey::new fails during partition initialization.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
api/lib/src/partition.rs Uses HsmError::from when mapping reset-related DDI failures.
api/lib/src/error.rs Adds logging to the generic map_hsm_err helper.
api/lib/src/ddi/partition.rs Adjusts DeviceCredKey::new error mapping during init.
api/lib/src/ddi/mod.rs Logs unmapped DdiError variants before collapsing to DdiCmdFailure.

@mhatrevi mhatrevi requested a review from rajesh-gali April 6, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add HSM error to DDI errors

2 participants