Adorning multiple enum
members with the @unknown
attribute is prohibited:
{% include “docs/reference/fidl/language/error-catalog/label/_bad.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/bad/fi-0072.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
Choose and annotate only the member that is used as a domain specific “unknown” value:
{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0072-a.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
The purpose of the @unknown
attribute is to smooth over a transition from a strict enum
with a user-defined unknown value, like this into a flexible enum
with unknown values known to and handled by FIDL:
{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0072-b.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0072-a.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}