Consolidate and harden NI-TLS create_grpc_channel error descriptions - #12
Merged
alexdubois-ni merged 2 commits intoAug 24, 2026
Merged
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Pull request overview
Consolidates NI-TLS channel errors and introduces a shared package exception hierarchy.
Changes:
- Adds common CLI and TLS exception base classes.
- Simplifies TLS validation and standardizes error guidance.
- Updates server-mode tests for fail-closed behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/nitlsconfig/errors.py |
Defines the exception hierarchy. |
src/nitlsconfig/cli.py |
Imports centralized CLI exceptions. |
src/nitlsconfig/grpc_channel.py |
Consolidates TLS validation and messages. |
src/nitlsconfig/__init__.py |
Exports the new exception API. |
tests/unit/test_grpc_channel.py |
Updates TLS mode and validation tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Test Results 12 files ± 0 12 suites ±0 15s ⏱️ ±0s Results for commit a7db719. ± Comparison against base commit 6baa5fb. This pull request removes 6 and adds 4 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
…ror posture of all errors underlying a single base
ckoellin
approved these changes
Aug 24, 2026
alexdubois-ni
deleted the
users/adubois/hardenErrorsAndMakeThemConsistent
branch
August 24, 2026 21:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this Pull Request accomplish?
Consolidate and harden NI-TLS create_grpc_channel error descriptions
Why should this Pull Request be merged?
As of today, I added quite a bit of fud and inactionable user information to our error descriptions. Furthermore, there is a lot of error scenario detection logic surrounding this as well that can be simplified by using a consolidated error messaging. In the end, the ONLY actionable user scenario is that a TLS configuration error occurred and that they need to check Hardware Manager that they did setup correctly. We should reflect this in the error description.
Last but not least, let's also create a base error class that user's of nitlsconfig can utilize to catch all error types from nitlsconfig and inherit from that separately between the Cli related errors and grpc_channel configuration related errors. This way, user's have a more flexible and streamlined error handling capabilities. Make minor improvements to the cli errors to ensure they all inherit from this base.
Lastly, also make an improvement to one of the most prominent errors which is: What to do when nitlsconfig is not even installed!
Note: We do not care about backwards compatibility yet since this package is not truly "released" yet in any form. It is all in alpha development.
What testing has been done?
Updated unit-tests accordingly.