-
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
Add CHIP_ERROR object methods #8784
Conversation
86939d8
to
2f2e1f4
Compare
#### Problem Having CHIP_ERROR be a class type provides type safety and the option to trace the source of errors. Since all platforms now use the class type, transitional code that provided for CHIP_ERROR to be either a class or integer type is no longer required and can be removed, which simplifies the class and some notation for using errors. #### Change overview - Remove the `CHIP_CONFIG_ERROR_CLASS` configuration option. - Add instance methods to replace the static `ChipError` functions, which were present to allow transitional integer overloads. To avoid breaking PRs in flight, the static methods remain present for now, marked “DO NOT USE”; they will be removed in a final cleanup PR. #### Testing Existing tests should confirm no change to functionality.
2f2e1f4
to
3201c96
Compare
@kpschoedel - merge conflicts |
Size increase report for "esp32-example-build" from 8511730
Full report output
|
So switching to class-type errors was not a problem in terms of codesize? I guess as long as |
Yes, I checked that before embarking on this conversion. With all the relevant things inline the code for a class-wrapped integer is generally identical to a bare one. |
I'll now start monitoring PRs for the obsolete functions and submit a final cleanup when it's safe. |
* Add CHIP_ERROR object methods #### Problem Having CHIP_ERROR be a class type provides type safety and the option to trace the source of errors. Since all platforms now use the class type, transitional code that provided for CHIP_ERROR to be either a class or integer type is no longer required and can be removed, which simplifies the class and some notation for using errors. #### Change overview - Remove the `CHIP_CONFIG_ERROR_CLASS` configuration option. - Add instance methods to replace the static `ChipError` functions, which were present to allow transitional integer overloads. To avoid breaking PRs in flight, the static methods remain present for now, marked “DO NOT USE”; they will be removed in a final cleanup PR. #### Testing Existing tests should confirm no change to functionality. * Rebase and regen to fix ZAP/Android after project-chip#8680 * Add assertions for bit fields
Problem
Having CHIP_ERROR be a class type provides type safety and the option to
trace the source of errors. Since all platforms now use the class type,
transitional code that provided for CHIP_ERROR to be either a class or
integer type is no longer required and can be removed, which simplifies
the class and some notation for using errors.
Change overview
CHIP_CONFIG_ERROR_CLASS
configuration option.ChipError
functions, whichwere present to allow transitional integer overloads. To avoid
breaking PRs in flight, the static methods remain present for now,
marked “DO NOT USE”; they will be removed in a final cleanup PR.
Testing
Existing tests should confirm no change to functionality.