 Hello, everyone. In this module, you will learn how to handle errors and exceptions in order component. So first, I will be implementing a component in that I will be throwing an error knowingly so that you can see like how errors or exceptions are available in order component. And in another component, I will be demonstrating how we can handle that exception. So let's first create unrecoverable error component. So I'm creating lightning component. Its name will be unrecoverable error. Clicking on submit. Now here I'm creating a lightning button. So this lightning buttons label will be through error on click off this button. I'm going to call this method. So this is simple example like button will be placed. And if you click on this button, so this method will be called and we will be throwing an error. So I'm saving this typo. So corrected this. Now it is saved clicking on controller. So I just need to copy this so that I can paste it here. Now here I need to write through new error. I cannot go. This is the end, right? So this is sample message that I implemented. So you can write any other message as well. Now if I want to test it, so I need to open demo application where I will be calling this component. So unrecoverable error. Saving this. Clicking on preview. So you will see your button on the UI. And if I click on this button, so here you can see that exception error is thrown, right? So I cannot go on. This is the end, right? Now, normally, what do you want to, what do you want? Like if any runtime exception or error is there. So your execution should not stop. Your error or exception should be handled properly and the remaining piece of code should be executed properly, right? So we can do that. So I'm going to create one more component now. That is recoverable error, right? So in that component, you will learn how we can handle runtime exceptions. So creating new lightning component, naming it as recoverable error and clicking on submit, right? So here I need to implement the code for the UI. So creating a P tag and writing, click the button to trigger the controller to throw an error. Now here I created a div and this div or ID is div one. After that, I'm going to create lightning button. So this lightning button label will be through error and on click, we are going to call this method through error, right? So this is the view file of this component. So the message, click the button to trigger the controller to throw an error. It will be rendered on the UI and this button will be displayed having label as through error. If you click on that button, so this through error method will be executed. And inside this method, we will be like creating a scenario where exception will be generated and that exception will be handled and the resultant value will be displayed with the help of this state. So let's implement controller so that you can understand how we can handle the exception. So naming it as through error, creating a variable named as has perm. So it is for permission. Then try if not has perm. So if this variable is having fault, so not will convert it into true. So we need to throw one error. So you don't have permission to add this record. So this is sample error message that we are going to throw. So after try, we need to implement catch. So whatever error will be thrown so that will be handled through catch. So try catch we basically use for exception handling. So if any error is thrown, so that will be handled through this catch. So now I need to create dynamic component. So in my previous module, I already demonstrated you like how we can create dynamic component as per the requirement. So here you will see it's real time use. So I'm creating component. So I'm creating UI message providing values to its property. So UI message first property is title. So title will be sample. Then second property is severity. So here I am putting error. So basically severity decide like which color should be there. So if it is added, so red color will be available with this message. After that, I'm putting comma. So I'm going to create one more dynamic component. So it will be UI output text and property is value. And in value, I'm putting E dot masses. So he is available here. So whatever a message is available in this E that will be value of this component, right? So closing it here, then it is closed then comma. Now I need to write function components, status, error message. And here I need to like map these dynamically created component with the UI. So here I'm checking if status triple equals to success. So variable masses equals to components of zero. So basically we created two dynamic component. One is UI masses and one is UI output text. So both will be available in this components. So component zero will provide this UI masses and components one will provide this output text. So masses will be available in this variable, like this zero UI masses component will be available in this masses variable. And now variable output text equals to components one, right? So I hope you understood how I fetched dynamically created components in separate variables. Now masses equal masses dot set V dot body output text, right? So this V dot body is attribute that is available in the components view, right? So we are fetching that and we are setting output text component into that body. So this body attribute is by default available. You don't need to create it. Then I'm creating one more variable as dev one and component dot find dev one. So basically we created a dev tag here and its or ID is the one. So through this or ID we are finding this in the JavaScript controller and the information will be available in this in this dev one. Now what I need to do, I need to write dev one dot set V dot body and message, right? So basically what we did in the body of the masses that output text will be available. So this masses will be outer component and this output text will be the inner component. So here we like nested output text with masses and masses we put in the body of this dev one, right? So body of the attribute that is available with each component that we use on the view. So this way this particular part is completed. So basically dev one will be having this masses and masses having internally output text, right? So we created two dynamic components and both both are nested and together they are mapped with the dev one, right? Now what I need to do, I need to implement else part. So else if status is incomplete. So console dot log no response from server or client is offline. Again else if status equals to error. So console dot log error then concatenating error message. So error message available here as an attribute and status is available as second parameter and components as first parameter. So this way we created dynamic components and we implemented this function so that we can set those dynamic components in the body of the view, right? So here it is closed. It is closed here then this one is closed then function is closed and this bracket is closed then this curly base. Okay. I think we need to put semicolon. So basically this is completed here. So I don't need this. Yep. Now it is completed. So and I need to place semicolon as well. So I think now everything will match. So here you can see this curly base of catch is matching and yeah, this is matching. So now everything is fine. So opening and closing of these brackets are important. So you need to focus on that. Now I'm just opening demo application and I'm going to use it there. So recoverable error component is placed clicking on preview. So now it will show a message along with the button and if I click on this button so you can see sample through error is available and you don't have permission to edit this record. This message is available. So what happened? Sample through error. This is the title of this message, right? Severity is error. That's why it is a red color and error message like you don't have permission to edit this record. So it will be available in this key that we are assigning into this output text as value and here I nested output text with masses and I like set masses in the body of this day one. So this way I demonstrated you like how we can apply exception and link to handle the errors on runtime with the help of dynamic components in aura. Thank you.