I doubt a definite answer exists but I'm quite interested in different opinions on the subject. A communiti wiki therefore.
You're designing a method. It serves a purpose, that's why you're designing it in the first place. A caller uses your method and the method fails, but, lo and behold, the ultimate purpose that exuse the existence of the method is nevertheless achieved -- thanks to external circumstances that are out of your control or some kind of magic, you choose. Would you report this situation to the caller as a failure or as a success?
Let's pick a trivial example. You're writing a DeleteFile
function. It takes a file path and deletes the file. Someone calls this function, providing a path. The function looks the file up, but it does not exist. It's not a permissions issue or something, the file is genuinely missing. Maybe another process deleted it a microsecond ago, and maybe it never existed at all. The function failed to perform its task, so it must report a failure... but the only reason why a user whould call this function is to make sure a file does not exist, and, voila, it does not, so it is a success.
I anticipate answers like "just be more verbose in your return values", and I'm happy to return a verbose result as a complimentary information, but what (and why) would you return as a primary success flag of the function, success or failure? Would it be FALSE with additional flag of BUT_DOES_NOT_EXIST_ANYWAY, or would it be TRUE with a BUT_THANK_SOMEONE_ELSE flag?
EDIT
Please do not give answers that only apply to the example above. I'm asking about situation in general, including when the method has no parameters or it is not possible to call it in a wrong way for some other reason.