Difference between revisions of "On error"
Jump to navigation
Jump to search
(New page: '''this is a proposed feature''' <pre> on_error(integer error_num, string error_text, integer recoverable) { if(error_num == STACK_HEAP) llResetScript(); } </pre> ===Restrictions=== If t...) |
|||
Line 1: | Line 1: | ||
'''this is a proposed feature''' | '''this is a proposed feature''' | ||
===Example=== | |||
This example should explain the proposal. | |||
<pre> | <pre> | ||
on_error(integer error_num, string error_text, integer recoverable) | on_error(integer error_num, string error_text, key error_state, integer recoverable) | ||
{ | { | ||
if(error_num == | if(!recoverable || error_num == ERROR_STACK_HEAP) llResetScript(); | ||
if(error_num == ERROR_BOUNDS_CHECK) | |||
{ | |||
... | |||
llClearErrorState(error_state); | |||
} | |||
} | } | ||
</pre> | </pre> | ||
=== | ===Notes=== | ||
If this exists a section of heap may need to be reserved for the error handler stack, so adding an error handler could reduce the available heap. The error handler should probably not (and may not be allowed to) allocate any local list or string variables. Errors in the error handler are fatal. | If this exists a section of heap may need to be reserved for the error handler stack, so adding an error handler could reduce the available heap. The error handler should probably not (and may not be allowed to) allocate any local list or string variables. Errors in the error handler are fatal. |
Revision as of 12:39, 30 August 2007
this is a proposed feature
Example
This example should explain the proposal.
on_error(integer error_num, string error_text, key error_state, integer recoverable) { if(!recoverable || error_num == ERROR_STACK_HEAP) llResetScript(); if(error_num == ERROR_BOUNDS_CHECK) { ... llClearErrorState(error_state); } }
Notes
If this exists a section of heap may need to be reserved for the error handler stack, so adding an error handler could reduce the available heap. The error handler should probably not (and may not be allowed to) allocate any local list or string variables. Errors in the error handler are fatal.