How about wrapping the return value in a templated error class that the caller has to explicitly unwrap with an error handler to be able to use?
(1) There are clever hacks to mimic this behavior to some extent, but I don't even want to go there. If you really want this feature - just use a language that has it.