3 ms·
For the maybe 2 or 3 times I've thought "we probably shouldn't include that in an error visible to end-users" there's probably 100 times I've wished it had been
by wizofaus 3y ago
For the maybe 2 or 3 times I've thought "we probably shouldn't include that in an error visible to end-users" there's probably 100 times I've wished it had been included though, and would've been able to save said end users considerable time if we/they had known which file/resource was being accessed at the point a critical error occurred.
At any rate at most I'd expect the file name to be written to a log file, to which only relatively privileged users would have access.
- junon 3y agoYes sure but to make it the default asserts that it's the correct thing to do in all cases. Those aren't assertions rust folks tend to make, and for things like logging that's really up to the application how things are logged anyway. Plus if you're issuing a filesystem call you're almost definitely in possession of the filename anyway so it's just a matter of format!("failed to write: {:?}: {:?}", err, filename).