property: Add errors support
Add errors support for properties.
Closes openbmc/openbmc#1641
Tested: Verified that when an interface threw a defined property
error, the generated code caught it and returned an error to
the REST call.
Change-Id: I8cb8c77995026f12e373291822e4e0a623a84d81
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/example/net/poettering/Calculator.errors.yaml b/example/net/poettering/Calculator.errors.yaml
index 730e2a3..b2f6ee3 100644
--- a/example/net/poettering/Calculator.errors.yaml
+++ b/example/net/poettering/Calculator.errors.yaml
@@ -1,3 +1,6 @@
- name: DivisionByZero
description: >
An attempt to divide by zero was attempted.
+- name: PermissionDenied
+ description: >
+ The user does not have enough privileges to perform the operation.
diff --git a/example/net/poettering/Calculator.interface.yaml b/example/net/poettering/Calculator.interface.yaml
index d289c21..af4dd1b 100644
--- a/example/net/poettering/Calculator.interface.yaml
+++ b/example/net/poettering/Calculator.interface.yaml
@@ -55,6 +55,12 @@
default: Success
description: >
The current state of the Calculator.
+ - name: Owner
+ type: string
+ description: >
+ The name of the owner of the Calculator.
+ errors:
+ - self.Error.PermissionDenied
signals:
- name: Cleared
description: >