Help - Search - Members - Calendar
Full Version: Catching Errors
Game Maker Community > Working with Game Maker > Extending Game Maker > Extensions [GEX]
D1g1talAli3n
This is a very simple script I made that will check if a certain error has occurred. Please note that this will only work in the Step, Begin step and End step events, depending on when the error occured. I recommend that you turn off show error messages in the Global game settings ( Although you can leave it on too smile.gif ). Also, this only works on Runtime Errors, not Compile-time errors (Compiling is when the game loads). A help file is also included.

Functions:
PRE

error_catch(type) // This function will return true if the specified error has occurred; you can see all the types by going to
Scripts->Show Extension Functions. Or just see the included help file.

error_ignore() // just a function that ignores an error, if you don't already know how to do it.



GM006.gif Download:

Solidfiles


HOST-A.net:


Mediafire:
Catching Errors.gex

Please report any bugs, as it is not exactly finished. But I don't plan on continuing it either tongue.gif
Please comment and download.
prog
This looks useful. You didn't include the help file though, so I can't tell how exactly it works.


Nevermind: I looked in the extention thing. I think I might use this. I don't think you got every possible error (which is a lot of them).
D1g1talAli3n
QUOTE (prog @ Sep 7 2009, 11:41 AM) *
This looks useful. You didn't include the help file though, so I can't tell how exactly it works.

Yeah, I'll add a help file soon. it'll probably be a PDF

EDIT: Ok I added a help file And edited the main post. just read the help file to see why all the errors aren't there.
OmegaDestroyer
I can't get it to catch anything. Can you put up a quick example of how error_catch should be implemented?
IceMetalPunk
I can't get it to work, either.

I put this in the STEP event:

CODE
str="Hello "+temp;
if (error_catch(er_WrongTypeOfArgumentsToPlus)) {
show_message("Why, that's not right!");
}
error_ignore();


I change "temp" to hold a number, and I just get the standard GM error message. If I disable error messages, nothing happens when the variable changes.

??

-IMP wink1.gif smile.gif
D1g1talAli3n
Thank you for the feedback, There seems to be a bug.

IceMetalPunk:
put the error_catch functions in the End step event, then try again.

OmegaDestroyer:
Ok, I will make an example soon.

I really don't know why this is happening, it lies somewhere deep inside GM's error reporting functions. You cannot detect an error right after you make one.

I will update the main post and the .gex's help file.

really sorry guys sad.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.