export class {{ class_name }} extends Error {
{%- if is_c_style_enum %}
  constructor(public readonly code: {{ type_name }}) {
    super(`{{ type_name }}.${{"{"}}{{ type_name }}[code]}`);
    this.name = '{{ class_name }}';
  }
{%- else %}
  constructor(public readonly value: {{ type_name }}) {
    super('{{ type_name }}');
    this.name = '{{ class_name }}';
  }
{%- endif %}
}
