public ErrorTrait errorTrait() {
        return shape().expectTrait(ErrorTrait.class);
    }
Gets the {@code error} trait.

<p>This is equivalent to calling {@code shape().expectTrait(ErrorTrait.class)}.

@return Gets the {@link ErrorTrait} of the error.
smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/directed/GenerateErrorDirective.java