Why should I add a precondition instead of just running into an error?

Hey

I know it sounds silly but I'm trying to understand when should I add a precondition to my apis and when it's just not nessacery

What's best practice here?

What problems would I encounter if an api gets an error which could have been avoided with a precondition?

2 replies