This depends more on personal style and context than grammar. Both are idiomatic. "Failure" represents the uncountable concept of failure, while "a failure" represents a specific instance where something has failed. You can choose whichever makes more sense in that particular context, or whichever sounds better to you.
On a side note: "Failure" may not be the correct word for the subject matter, as it can imply something has failed in the structure or in the design. In software, when something goes wrong it is called an error, and are usually not a problem when they are properly handled (as it sounds like in your example).
This can also apply when talking about a physical device. The machine might throw a warning/error in performing some task, which then the embedded software will handle.