examples: app*: refactor error enum to a utils module
The module also contains a create_element macro and a link_elements function to help reduce boilerplate.
The module also contains a create_element macro and a link_elements function to help reduce boilerplate.