[Include] try/catch error handling
#1

This adds try/catch statements to Pawn, very similar to those in other languages.

A good usage area is commands. The player who typed the command wants to know why the command failed. Why it failed, however, could be due to an error inside a function inside nested calls.

Normally when functions fail they just return 0, -1, or something similar. While that works in many cases, sometimes you want to inform the user of where and why it went wrong.

Refer to the tutorial for more information.

Code: https://github.com/oscar-broman/exceptions (be sure to look at this topic for updates)
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: 1 Guest(s)