From the course: Replit 101: From Prompt to Product
Fixing errors and recovering from disaster - Replit Tutorial
From the course: Replit 101: From Prompt to Product
Fixing errors and recovering from disaster
Your app has crashed. Error messages in coding applications are not great because not only are they really big and scary and the consequences of even tiny errors are rather enormous, but they often come with this giant block of just incomprehensible text along with it as if that's somehow helpful. Well, it is helpful if you understand exactly what's going on and it helps you trace the error back to where it started, but it's only helpful if you have a full understanding of how the app works and you have a deep understanding of the specific coding language and framework and everything else that's going behind it. So if for some reason you find yourself in this situation, which honestly is very unlikely, I had to go in and commit some coding crimes for this to happen, but if you get an error like this or a huge black and red error on the middle of your app saying something is wrong. Here's how you go about addressing it. In this case, you get a nice button at the bottom that says debug with agent. Can also open it and say either debug in new chat or in the current chat. So I'll say debug in current chat. And the agent now starts working on the problem to try to figure out what's going on and how to solve it. It's recovering. And what it did was probably just revert back to our previous state where things were working properly. And at the end of the process, it says, I fixed a syntax error that was causing the app to fail. The logout button for admins should now be working correctly on both the home and talk pages. How does that look to you? This is a typical LLM thing where it's saying, oh, there was an error, but instead of telling you what the error was, it's just saying what it did previously in its history. So that would be to fix the login button, because that's where we are in the history right now. But this just goes to show you, even if everything fails, you can actually recover thanks to the agent. And you also always have the option to go back in the history and find a previous state where you know things worked and just revert to that previous state. Bottom line, there's no error that you can encounter in this system that is bad enough that you can't recover from it. either by asking the agent to fix the problem or by going back to an earlier state. In most cases, when you see an error, you can simply tell the agent in the chat, hey, there's an error on my screen, and the agent will go in and just fix it automatically. When things go badly enough wrong, it'll even provide you with a button to say, nothing is working, click here to fix the problem, and it'll again fix the problem for you.