Commit 4794aab
BugFix(SDKError): Correct error formatting in SDKError __str__ method… (#1588)
… (#1587)
### BugFix: Correct error formatting in SDKError.__str__
#### Problem
Calling `str(SDKError)` raised the following runtime error:
`looker_sdk.error.SDKError: <exception str() failed>`
This happened when the SDK attempted to convert the error to a string,
which failed due to a malformed generator expression or naming conflict
during the formatting of `self.errors`.
#### Fix
Updated the loop variable in the generator expression from `error` to
`error_details` to:
- Avoid potential name shadowing.
- Improve clarity and correctness of the `__str__` implementation.
- Resolve the runtime error so the error can now be printed correctly.
#### Notes
- The variable `error_details` represents a single instance; per PEP 8,
we may later rename it to `error_detail` for readability.
Co-authored-by: Kiran R <71453237+kiran2706@users.noreply.github.com>1 parent 8e80ac5 commit 4794aab
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
0 commit comments