next up previous
Next: What to Turn In, Up: BufMgr Previous: Where to Find Makefiles,

Error Protocol

Though the Throwable class in Java contains a snapshot of the execution stack of its thread at the time it was created and also a message string that gives more information about the error (exception), we have decided to maintain a copy of our own stack to have more control over the error handling.

We provide the chainexception package to handle the Minibase exception stack. Every exception created in your bufmgr package should extend the ChainException class. The exceptions are thrown according to the following rule:

Basically, the ChainException class keeps track of all the exceptions thrown accross the different layers. Any exceptions that you decide to throw in your bufmgr package should extend the ChainException class.

For testing purposes, we ask you to throw the following exceptions in case of error (use the exact same name, please):

Feel free to throw other new exceptions as you see fit. But make sure that you follow the error protocol when you catch an exception. Also, think carefully about what else you need to do in the catch phase. Sometimes you do need to unroll the previous operations when failure happens.


next up previous
Next: What to Turn In, Up: BufMgr Previous: Where to Find Makefiles,
2011-10-03