[Include] try/catch error handling
#8

@whitetiger: I didn't make it yet. I'm trying to figure out how to.


I wouldn't recommend using this to be sloppy with array indexes, zero divisions, memory allocation, stack/heap, etc. just because it will catch the errors.
Runtime errors should be fixed and avoided using sanity checking.

The main idea is this should be used to throw and catch custom errors.

Also note that runtime errors will cause the outer public to return 0, essentially. If you catch an error in OnPlayerCommandText it will print "SERVER: Unknown command". Everything else will still work, but you can't get rid of that message (unless you make a 0ms timer and do everything in that timer function).
Reply


Messages In This Thread
try/catch error handling - by Slice - 24.03.2013, 16:49
Re: try/catch error handling - by Dan.. - 24.03.2013, 17:03
Re: try/catch error handling - by Slice - 24.03.2013, 17:16
Re: try/catch error handling - by Dan.. - 24.03.2013, 17:34
Re: try/catch error handling - by Whitetiger - 24.03.2013, 19:37
Re: try/catch error handling - by Dan.. - 24.03.2013, 19:41
Re: try/catch error handling - by Misiur - 24.03.2013, 19:46
Re: try/catch error handling - by Slice - 24.03.2013, 20:21
Re: try/catch error handling - by Slice - 05.04.2013, 21:35
Re: try/catch error handling - by Slice - 05.04.2013, 22:54

Forum Jump:


Users browsing this thread: 3 Guest(s)