Handling Specific Schema Decoding Errors in Effect Typescript

Is there a recommended way if I want to throw an error based on a specific property in a schema decoding error failing?

So let's say e.g. the schema is a struct with

{
    identifier: Schema.Literal('someIdentifier'),
    details: Schema.Struct({...}),
    description: Schema.String,
}


Where later on I might have a union with different literals as identifier and different expected detail structures. When the identifier is "not known" / unexpected I want to throw a different error (and eventually something elso to the end user", then if e.g. the details are slightly off. So not just a different message for that one thing, but really a different handling of the two cases.
Was this page helpful?