Add CHIP_ERROR object methods (#8784)
* 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 #8680
* Add assertions for bit fields
diff --git a/src/app/tests/TestMessageDef.cpp b/src/app/tests/TestMessageDef.cpp
index c319a42..2096876 100644
--- a/src/app/tests/TestMessageDef.cpp
+++ b/src/app/tests/TestMessageDef.cpp
@@ -66,7 +66,7 @@
if (CHIP_NO_ERROR != err)
{
- ChipLogProgress(DataManagement, "DebugPrettyPrint fails with err %" CHIP_ERROR_FORMAT, chip::ChipError::FormatError(err));
+ ChipLogProgress(DataManagement, "DebugPrettyPrint fails with err %" CHIP_ERROR_FORMAT, err.Format());
}
return err;