-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Python] Store original PyChipError in ChipStackException #33954
Merged
mergify
merged 6 commits into
project-chip:master
from
agners:fix-and-improve-error-handling
Jun 18, 2024
Merged
[Python] Store original PyChipError in ChipStackException #33954
mergify
merged 6 commits into
project-chip:master
from
agners:fix-and-improve-error-handling
Jun 18, 2024
Conversation
This file contains 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
PR #33954: Size comparison from 4d5e2ee to a2a072d Full report (11 builds for cc32xx, mbed, nrfconnect, qpg, stm32, tizen)
|
agners
force-pushed
the
fix-and-improve-error-handling
branch
2 times, most recently
from
June 17, 2024 17:36
66ad50d
to
00b882f
Compare
pullapprove
bot
requested review from
andyg-apple,
anush-apple,
arkq,
bauerschwan,
bzbarsky-apple,
carol-apple,
cecille,
chrisdecenzo,
chshu,
chulspro,
cliffamzn,
Damian-Nordic,
dhrishi,
fessehaeve,
harimau-qirex,
harsha-rajendran,
hawk248,
hicklin,
jepenven-silabs,
jmartinez-silabs,
jmeg-sfy,
joonhaengHeo,
jtung-apple,
kiel-apple,
kkasperczyk-no and
kpschoedel
June 17, 2024 17:37
agners
force-pushed
the
fix-and-improve-error-handling
branch
2 times, most recently
from
June 17, 2024 20:52
b8fbe7b
to
32e8a2d
Compare
PR #33954: Size comparison from 8ba371a to 32e8a2d Full report (49 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, tizen)
|
agners
force-pushed
the
fix-and-improve-error-handling
branch
2 times, most recently
from
June 17, 2024 22:05
1529942
to
89dcb44
Compare
Also remove the now unused pychip_Stack_ErrorToString function. This is handled in pychip_FormatError today.
agners
force-pushed
the
fix-and-improve-error-handling
branch
from
June 17, 2024 22:06
89dcb44
to
759b7b0
Compare
PR #33954: Size comparison from 8ba371a to 759b7b0 Full report (11 builds for cc32xx, mbed, nrfconnect, qpg, stm32, tizen)
|
PR #33954: Size comparison from 8ba371a to d7f7219 Full report (85 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
agners
force-pushed
the
fix-and-improve-error-handling
branch
from
June 18, 2024 06:28
d7f7219
to
f22deb0
Compare
PR #33954: Size comparison from 4cdce52 to f22deb0 Full report (85 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
arkq
approved these changes
Jun 18, 2024
Use PyChipError return value where PyChipErrors are actually returned. This then also allows us to use the typical .raise_on_error() pattern.
This change stores the original PyChipError in ChipStackException so that details of the original error code can still be retrieved. This is interesting to use the properties returning processed information about the original error code. It also preserves the line and code file which can be helpful.
NativeLibraryHandleMethodArguments correctly setting the arguments uncovered some incorrectly set arguments.
NativeLibraryHandleMethodArguments correctly setting the argument types causes argument type errors: ctypes.ArgumentError: argument 1: TypeError: expected LP_c_ubyte instance instead of bytes We can safely cast bytes as the native side marks it const.
agners
force-pushed
the
fix-and-improve-error-handling
branch
from
June 18, 2024 10:36
f22deb0
to
9255a8b
Compare
PR #33954: Size comparison from 4cdce52 to 9255a8b Full report (85 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
diogopintodsr
pushed a commit
to diogopintodsr/connectedhomeip
that referenced
this pull request
Jun 20, 2024
…ip#33954) * [Python] Drop unused ErrorToException function Also remove the now unused pychip_Stack_ErrorToString function. This is handled in pychip_FormatError today. * [Python] Cleanup PyChipError return values Use PyChipError return value where PyChipErrors are actually returned. This then also allows us to use the typical .raise_on_error() pattern. * [Python] Store original PyChipError in ChipStackException This change stores the original PyChipError in ChipStackException so that details of the original error code can still be retrieved. This is interesting to use the properties returning processed information about the original error code. It also preserves the line and code file which can be helpful. * [Python] Fix Command API argument type errors NativeLibraryHandleMethodArguments correctly setting the arguments uncovered some incorrectly set arguments. * [Python] Use to_exception() to convert PyChipError to ChipStackError * [Python] Fix Cert API argument type errors NativeLibraryHandleMethodArguments correctly setting the argument types causes argument type errors: ctypes.ArgumentError: argument 1: TypeError: expected LP_c_ubyte instance instead of bytes We can safely cast bytes as the native side marks it const.
agners
added a commit
to agners/chip-wheels
that referenced
this pull request
Jun 20, 2024
This adds commissioning API updates from the master branch to our 1.3 based branch. This makes the commissioning API more Pythonic and allows to call them from the asyncio event loop directly. Specifically, this integrates changes from the following PRs - project-chip/connectedhomeip#33954 - project-chip/connectedhomeip#33905 - project-chip/connectedhomeip#34011 - project-chip/connectedhomeip#34001 - project-chip/connectedhomeip#33989
agners
added a commit
to home-assistant-libs/chip-wheels
that referenced
this pull request
Jun 20, 2024
This adds commissioning API updates from the master branch to our 1.3 based branch. This makes the commissioning API more Pythonic and allows to call them from the asyncio event loop directly. Specifically, this integrates changes from the following PRs - project-chip/connectedhomeip#33954 - project-chip/connectedhomeip#33905 - project-chip/connectedhomeip#34001 - project-chip/connectedhomeip#33989
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.
This change stores the original PyChipError in ChipStackException so that details of the original error code can still be retrieved. This is useful to get access to the properties returning processed information about the original error code. It also preserves the line and code file which can be helpful.
This also makes sure to use PyChipError return value where PyChipErrors are actually returned. This then also allows us to use the typical .raise_on_error() pattern. Previously, in several places just
c_uint_32
was used, which worked because that was the first element of thePyChipErrors
struct. Using the correct typePyChipErrors
is cleaner.A drive-by find here was that ctypes functions argtypes did not get set correctly by the
NativeLibraryHandleMethodArguments
helper. Adjusting this caused some additional fixes.