xref: /openbmc/sdbusplus/docs/yaml/error.md (revision 43fcd1ce)
1# Error YAML
2
3D-Bus errors can be defined by creating a YAML file to describe the errors. From
4this YAML file, both documentation and binding code may be generated. The
5generated bindings are C++ exception types corresponding to the D-Bus error
6name. Ex. `org.freedesktop.Example.Error.SomeError` will create a generated
7exception type of `sdbusplus::error::org::freedesktop::example::SomeError` which
8may be thrown or caught as appropriate. If the error is thrown from an interface
9method which has specified it may return that error, then the bindings will
10generate a catch clause that returns a D-Bus error like
11"org.freedesktop.Example.Error.SomeError" to the method caller.
12
13The error YAML is simply a list of `name` along with optional `description` and
14`errno` properties. Example:
15
16```yaml
17- name: SomeError
18- name: AnotherError
19  description: >
20    This is another error.
21  errno: E2BIG
22```
23