They define expected errors and handling strategies.
Error contracts specify which exceptions can be thrown by an API, allowing users to understand and prepare for possible failures. This clarity helps developers build reliable systems. For example, a method might declare it throws IllegalArgumentException, signaling clients to validate inputs before calling it.