Events used to allow the error syntax, but this is now deprecated:
{% include “docs/reference/fidl/language/error-catalog/label/_bad.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/bad/fi-0119.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
Instead, specify the event without an error:
{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0119-a.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
Alternatively, model the error as a union instead:
{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0119-b.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
Using the error syntax with events was already an unusual thing to do before it was deprecated. Events are server initiated, and it seems strange for the server to send an unsolicited failure to the client. It is better to use a union for these rare use cases rather than having to support a language feature in all the bindings.