Safe-DS / DSL

Statically checked Data Science programs.
https://dsl.safeds.com
MIT License
14 stars 0 forks source link

Optional error messages for constraints #1082

Open lars-reimann opened 6 months ago

lars-reimann commented 6 months ago

Is your feature request related to a problem?

All constraints currently have a standard error message. It would be nice to be able to customize this

Desired solution

New syntax:

... where {
    p > 0 else "Message"
}

The message must evaluate to some constant string if we know parameter values. This would also allow template strings that reference the parameter value.

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response