fix: preserve per-reference error context in ClientImage.save() and update callers#1223
Open
meet114 wants to merge 1 commit intoapple:mainfrom
Open
fix: preserve per-reference error context in ClientImage.save() and update callers#1223meet114 wants to merge 1 commit intoapple:mainfrom
meet114 wants to merge 1 commit intoapple:mainfrom
Conversation
Contributor
|
These changes aren't inherently wrong and we do need to fix the error handling for most of these functions, but all of this will just add more tech debt. There is a big transition to update all the resources (image, volume, etc.) to conform to the new ManagedResource type. Furthermore, we are working on revamping error handling/propagation. The changes you made are going to be reworked based on the direction we decide to take in #1126 and #1086. The discussions and changes have been on the back burner, due to higher priorities. I plan to get them moving again soon, since they should create "good first issues" that new contributors can pick up and work on. |
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.
Type of Change
Motivation and Context
The
ClientImage.save()method had aTODOto improve error handling. Previously, get(names:) returned failed references as plain strings, discarding the underlying error cause (e.g., not found vs. parse failure vs. network error). The save() method then threw a generic .invalidArgument error with no detail about why each reference failed. This made it difficult for users to diagnose and fix issues when saving multiple images. This change introduces ImageLookupError to preserve per-reference error context, updates all callers (save(), ImageInspect, ImageDelete) to use the richer error type, and changes the error code to the more semantically accurate .notFound.Testing