In the previous two chapters, we talked about object-oriented programming and about input and output, which is implemented using objects. In this chapter, we continue working with objects and will discuss another area in Perl 6, whose implementation extensively uses classes and has a vast hierarchical structure.
Exceptions are situations where the program enters such a state that it cannot run further. Some exceptions are caused by flaws in the design of a program, others happen because of external factors, such as disk failure or broken connection to a database. In this case, an exception is not something extraordinary that has to stop the program but a way to handle the error and continue execution.
In this chapter, we will talk about exceptional situations that a program can be faced with. Moreover, we will also see ways a in which programmer can prevent...