Gamemaker was created with beginning developers as it's target audience. Because of this we are able to get away with so many things without receiving errors and error messages. This is good for the beginner because it prevents some frustrations when first starting out. Many times after developers gain experience they find ways AROUND the error messages they do receive, instead of dealing with them. Take this picture for example.

Things like this are SO COMMON. Now this example is extreme, but I have seen it. If you EXPECT an object to be in the room, do not work your way around it just to avoid an error. Error messages ARE GOOD. They are telling you that something needs to be changed. Embrace them and build more. Lets talk about custom error handling.
Custom Error Scripts
So, looking at the previous example what is something better we can do? Well what about have it tell us that something is wrong instead of ignoring it. We could have it warn us and continue running, or if it's an issue we will obviously have to fix we can have it tell us what is wrong and then exit the game. (This is especially useful if you have one of the games where you have to use the exit button in game to get out of the application.. don't do that either).
So how do we want to warn ourselves. How about we bring it front and center with a simple show_message("ERROR"); That would work decent but lets take it a step further. Lets make it really easy for us to create errors. Lets make one script that will display an error message to us, and a second one that will display a message then exit the game. We will call the first scrErrorWarning and the second scrErrorFatal. Lets go over the warning first.
So create a script called scrErrorWarning and we will plop this simple code:

It is a pretty simple script that takes in a string. It appends the object that calls the script to the front, and you can add whatever other information you want to it. Lets go ahead and create our scrErrorFatal as well. The only change is that we end the game after the message displays.

Cool deal, same thing but ends the game after the user clicks OK. Now lets apply it to our original code. Not only can we handle the error the way we were before but we can at least notify our self if it is to happen!

And our resulting message that will display should this happen is this!!!

Now instead of hiding an error we have brought it to the front. You can easily also log these errors in the debug console or handle them however you please. The important part is please don't suppress errors, it only hurts you.. BAD. Use these two scripts and start catching things yourself before Gamemaker even does. It is super easy and very effective, and I hope it helps someone. I will be doing another blog soon that will use these error scripts, so if you followed along be sure to look out for those :)
Have a Fantastic Development Day!