Correct Way to Display Spark.Error.DslError?
Hi! Iām writing a custom DSL extension and Iām struggling with making
Spark.Error.DslError
show up in the right place.
I followed patterns from core Ash code (like default_accept.ex
and verify_identities.ex
), and also looked at extensions like Ash Cloak. Here's what I did in my verifier:
This seems not to raise, so I tried again this time in the transformer code:
This raises as expected, but the error isn't tied to the DSL location. It does show up, but only on line 1 of the module.
Is there a recommended way to raise Spark.Error.DslError
so that it points you to the invalid DSL section or field?
Any help or examples appreciated! š3 Replies
Currently spark DSL errors cannot point at source locations. It's a feature I'd like to support.
How does Ash do the context errors? Is it validation on the Spark.Dsl.Entity? š¤

Just realized Ash Cloak doesn't modify the default actions. Is that intentional?
my bad, forgot
def after?(Ash.Resource.Transformers.DefaultAccept), do: true