Module Three Exception Handling Activity InstructionsThis instruction guide

Module Three Exception Handling Activity InstructionsThis instruction guide will support your Module Three Exception Handling Activity. StackTest.cppIn StackTest.cpp, uncomment the very first try-catch block in method testPop().Save/recompile your project. You should get several errors, because CustomStackException has not been defined. Verify that that is the cause of your errors, then continue.2. The CustomStackException ClassCustom exceptions can be developed to catch errors specific to our code or we can use structured exception handling to catch errors common to the Window Operating System.  For more information on structured exception handling click on this link.  For this activity we create a custom exception by defining a CustomStackException class that our Stack class can use when something goes wrong. At the beginning of Stack.h, uncomment the #include directive that includes CustomStackException.h. After making these changes, save/recompile your project. If all is well, your project should compile correctly. If not, find and correct the error(s).The class has two instance variables:myLocation, to which a method can pass its name (to indicate the exact method in which something went wrong)myMessage, to which a method can pass a description of what is wrongThe CustomStackException constructor initializes these members using values it receives through its parameters. For example, if at the beginning of the pop() method, we find that the stack is empty, we can build an exception like this:   StackExcept(“pop()”, “stack is empty”)If at the beginning of the the push() method, we find that the stack is full, we can build an exception like this:   StackExcept(“push()”, “stack is full”)The asString() method generates a string representation of these values, accompanied by some descriptive labels.At the bottom of CustomStackException.h, there is a definition of operator<< that lets us output a CustomStackException using the usual C++ stream-insertion operator.When your project compiles correctly, run it. You should see execution halt in the testGetTop() method. The problem is that our testPop() method now expects a StackException to be thrown when we send the peekTop() message to an empty Stack. Continue, and we will see how to accomplish this.3. Throwing ExceptionsNow that we have created a CustomStackException class by which we can precisely describe unusual circumstances, we can use that class in our Stack methods. As mentioned previously, a method that detects a problematic circumstance can throw an exception. For example, if the stack is empty, there is no top item for the peekTop() method to return, in which case we might make it throw a CustomStackException, as follows: Item Stack::peekTop() const {      if ( isEmpty() ) {         throw CustomStackException("peekTop()", "stack is empty");      } else {         return myArraymySize - 1;      }   }Recompile and rerun your project. With these changes, what you have written should pass all the tests. Continue when it does so.4. The ConstructorUncomment the try-catch block in the testConstructor() method. Save/compile your project. Run it, and verify that it fails inside the try block.Using what we did with peekTop() as a model, modify the Stack constructor so that when its precondition is false, the constructor throws a CustomStackException with the message Stack(size): size must be positive!. Continue when your project passes all tests.5. The pop() MethodUncomment the try-catch blocks in the testPop() method.Save/compile your project. Run it, and verify that it fails inside the try blocks.Using what we did with peekTop() as a model, modify pop() so that it throws a CustomStackException with the message pop(): stack is empty!. Continue when your project passes all tests.6. The push() MethodOur final operation is the push() operation. Uncomment the try-catch blocks in testPushPeekTopAndIsFull(). Save/recompile, and verify that your project no longer passes the test.Using what we did previously as a model, modify push() so that it throws a CustomStackException with the message push(): stack is full! Continue when your project passes all tests.