Presumes that an error code provides sufficient context to determine what the actual problem is. It does not. Which is why exceptions carry some form of text error message which may include (for example) the name of the file that could not be opened because permission was denied.
What data can you encode in an out-of-band return value (exception), that you can't encode in a parameter or in-band return value? An exception isn't a magic data type, there is nothing you couldn't also return as a return value or a parameter.
The filename to be opened is likely passed as a string in an argument, so it IS present in the function interface contract.
Awful stuff.