4 ms·
No, because that's not desired behavior in all cases. There can be security/privacy issues stemming from that. Making it the default means you have to do string
by junon 3y ago
No, because that's not desired behavior in all cases. There can be security/privacy issues stemming from that. Making it the default means you have to do string manipulation to cut out information you don't otherwise want, which is way less robust and more fragile than simply not including it in the first place.
- wizofaus 3y agoFor 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).