Exception Handling Models
Two basic models available in Java
Termination
Resumption
Termination model: When an unrecoverable error occur while executing a program, then that program needs to be terminated without re-trying. These are also called unchecked exceptions (RuntimeException, Error, and their subclasses)
Ex: Stack overflow is an example for this. During an application execution, if Stack overflow error occurs, then application terminates and there is no way to recover from it
Resumption model: When a recoverable error occur during a program execution and it tries to recover from it. These are called checked exceptions(all classes except RuntimeException, Error and their subclasses). Well written program should anticipate errors and try for recovery
Ex: When trying to connect to internet error might occur (connection error), then you may want to try again
Exception Hierarchy
Any exception in java is an instance of a class derived directly or indirectly from the Throwable class
Throwable is the super class
Error and Exception classes are derived from Throwable class
There are numerous pre-defined errors that are derived from the Error and
RuntimeException classes
Exceptions derived from the Error object represent problems with the JVM and normally can’t be recovered and a little that a programmer will do with these. Stack overflow is an example of such an error
Exception types and it’s Hierarchy
Exception class support two types of exceptions:
Checked: These are exceptions that need to be dealt within the code
Checked exceptions include all exceptions derived from the Exception class and are not derived from the RuntimeException class
These must be handled in the code or the code will not compile cleanly, resu...
... middle of paper ...
...ys:
Specific error checking: For ex. You can check for a specific error like FileNotFoundException
Group error checking: For ex. You can check for a Group of errors like IOException. This IOException, is a generalized exception. Using this we can catch all I/O related errors
Any type of error: For ex. You can catch any type of errors by specifying Exception. This will catch any type error that occur during program execution. Exception is the super class and subclass of Throwable class
The Exception class is close to the top of the Throwable class hierarchy
You can define exception handlers to be as specific as possible
A handler must determine what type of exception occurred using recovery strategy
Exception handlers that are too general can make code more error-prone
Finally,
Grouping exceptions in a general fashion
Differentiating exceptions in an exact fashion
A death that occurs in a patient due to preventable complications is called failure to rescue (Mackintosh). A patient in an
Fault tolerance is the property that enables a system to continue operating properly in the event of a failure.
The term incident refer to the combine set of occurrences of both incident and near misses.(Otong,2001) it refer to unwanted event involving safety incident with environment impact. Incident is not one person failure it may involve the system
Each transaction is stored in a log file that will be useful, in conjunction with the error files, in case one of the processes fails validation to go back and find out which process was to determine the cause of the
The reasons for this - a missing hyphen. However there are many more reasons for software systems failure, and most of them are due to human negligence that leads to software failure. There are two types of software systems...
If the error is detected during a later stage of software development, The developers will require to do a lot of reverse engineering processes which will be very frustrating and time consuming, the developers will have to review preceding steps and rework their deliverables and also might have to start from scratch. The later the software error is detected the more the number of people will be affected by it. This will in turn result to an increase in the cost required to communicate with the affected people and then fix the error. Thus, the cost for communicating the details of the defect, distributing and applying the software fixes and probably retain and convince the end users to use this particular software that has been sold to hundreds and thousands of customers will be too high. Once the goodwill and the brand value of the software is affected it is difficult to regain the customers trust. Ensuring early fixing of errors will save the developers
Minimal Error Could Mean Big Loss: When things go wrong with the system, large amounts of data or information can be lost. This can become a problem if not handled in a timely manner. Clients information is considered sensitive and if lost can be hard to retrieve.
A possible addition application would be to remove a chip layer form a stack. If a failure has accorded in a layer other than the top layer then removing these layers will be the objective.
Nevertheless, in researching each of them, clearly, there is somewhat of a caveat to all, and an attempt to provide justification for them. Accordingly, I have categorized each and given an example of a situation to illustrate their differences more clearly, and they are as follows:
Flight crew error is defined as an action or inaction that leads to a deviation from stranded
...mpany up and running through any kind of interruptions such as power failures, IT system crashes, natural or man-made disasters, supply chain/vendor problems and more.
One of them could be the system could crash as if not saved data can
To err is human. Throughout everyday life, human error is around every corner. Human error is defined as, “a mistake made by a person rather than being caused by a poorly designed process or the malfunctioning of a machine such as a computer.” (Encarta, 2009) To simplify this definition, people make mistakes.
Failure. What is it to you? For me, failure is the lack of change when I make a mistake. My third grade teacher, Mr. Ramirez, had used the quote “Un error es uno que no se no corrigen,” through the school year, but I never understood what it meant. On the last day, Mr. Ramirez explained the phrase as “A mistake is only a mistake if you do not fix it.” I didn’t really see its importance on that day, but by the end of fifth grade, and I was getting ready to leave elementary school, I realized the significance of Mr. Ramirez’s proverb.
Buffer overflow. This happens when the computer transmits more than the buffer can hold hence causing congestion as the data is dropped and a lot is lost. The adjacent memory spaces are overwritten and corrupted and can cause even the system to crash. Buffer overflow also known as buffer overrun can be avoided by having system checks regularly in order to detect and fix the overflow. The operating system responds through segmentation faults.