In fact the prevalent view is that code is unreliable and you should structure things to recover from failure at all points of the architecture. Messages can go missing. Calls can time out. Processes can crash for reasons you will never know about, and your architecture should be resilient against that.
Whilst this sounds extremely complex, in practice it boils down to letting everything low level fail, and having supervisors who can handle the failure.
Resource issues are a problem everywhere. For example, you want to save a file.
What happens if the file system crashes after it claims it has saved?
What happens if its a network connected drive, and it times out?
What happens if its a file on Amazon S3, and your network cable just got cut by a tractor?
You're going to have to deal with this at a higher level than the line of code which tried to save the file.