Friday, November 7, 2008

Cascading error loss in Software

Cascading error is a phenomenon where one error condition leads to another error. This is more common than expected. Generally an error which is not expected to occur will lead to the error getting cascaded into another error. Since, the first error itself was not expected the error generated as a result of the first error will also be unexpected. Thus a cascade of errors continues.

Consider the example of a special character in the input a program. The special character will miss all the given conditions and will go to a error handling mechanism. The error handling mechanism may again fail due to the special character. This leads to a cascading error condition.

Now coming to the serious problem of error loss. A very serious error may get lost in the cascading error due to reduction in error severity. The severity of the error may get reduced in each step of the cascade and finally end up as a info alert. Although programming languages like Java have dedicated error handling mechanisms, the very nature of cascading errors makes it difficult to catch them. Thus, its better to have a catch all exceptions condition that reports the error that has been caught as the highest possible error severity, as the severity might have got reduced during the cascade.

Let me tell you a story to explain how cascading error loss occurs. A shop catches fire at night and starts burning. The onlookers see the burning shop and the news about the fire starts to spread. By the time the news reaches the owner of the shop, the location of the shop is not very clear. The shop owner comes to know about a shop on fire but does not realise that its his own shop. Similarly a very serious error can be overlooked due to cascading errors.

No comments: