Until I started programming microcontrollers, I've always had a habit of checking function arguments and various error conditions and report them somehow. E.g. printf, a popup window, or a file, on PCs or larger computers.
Generally I would convert "void ()" routine calls into functions returning success or error status, so I have error processing along a call chain.
I know it's difficult on a micro. There are space issues for the extra code, and there is often no way to report the error.
Still, I'm curious how you professionals are doing it. For instance, I'd love to take a peek at the structure of the code inside a Honeywell thermostat, Ademco security system, or some washing machine and see if their routines are all void() or if they stash a code somewhere that an installer can access with a special menu and then count LED blinks etc.
Or do people tend to run watchdog timers and try to cover up any odd occurrences with soft resets ?