Integration - what to do on method failure?

Like to understand the best practice for handling a failure. First, the use case.

Let’s say I’m implementing a climate entity and the method to turn the fan on gets called with an invalid fan mode.

I could:
Log an error
Throw an exception (if so what base type)

Ideally the error would propagate back to the UI or Automation, so that it knows the requested operation failed?

You can do both.
See homeassistant.exceptions — Home Assistant 2021.6.2 documentation for the list of HA exceptions.

I have the integration throwing a HomeAssistantError when it encounters an error.

For example, a service call to set the HVAC mode of a climate entity to “Heat” when the zone does not support heat.

What happens is:

First, HA logs the error with a complete stack traceback - so it looks very messy in the log. It appears it is treating this as an unexpected exception vs an expected exception?

Second, the exception information does not make it back to the caller (in this case the service panel in the developer tab)

Based on this, it seems that throwing an exception does not accomplish much and creates a messier log file - and the best approach is just to log the error and return.

Thoughts? What am I missing?