| ER_catch | Function (ROM Call 0x154)

error.h

short ER_catch (void *ErrorFrame);

Catches an error.

ER_catch sets up an error handler. It saves the task state in ErrorFrame, which is usually a buffer of type ERROR_FRAME, and returns 0. The state consists of the values of A2-A7, D3-D7, and PC. It also records a pointer to the previously saved state, which makes it a linked list/stack, and yet another two system pointers.
If ER_throwVar is called later on (note that some TIOS routines may perform ER_throwVar in a case of error), it simulates a return from the previously called ER_catch, and the error code passed into ER_throwVar will become the result of ER_catch. The processor must be in User mode for this to work properly.
Note: Usually you should not call this function explicitely. Use the TRY macro instead.

Uses: NG_control, NG_such_that_index
Used by: ERD_dialog, ERD_process, TRY, HeapAllocESTACK, HeapWalk, cmd_blddata, cmd_circle, cmd_cubicreg, cmd_custom, cmd_dialog, cmd_disp, cmd_disptbl, cmd_drawfunc, cmd_drawinv, cmd_drawparm, cmd_drawpol, cmd_expreg, cmd_get, cmd_input, cmd_inputstr, cmd_linetan, cmd_linreg, cmd_lnreg, cmd_logistic, cmd_medmed, cmd_newdata, cmd_newpic, cmd_newprob, cmd_onevar, cmd_output, cmd_pause, cmd_popup, cmd_powerreg, cmd_prompt, cmd_quadreg, cmd_quartreg, cmd_request, cmd_send, cmd_sendcalc, cmd_sendchat, cmd_shade, cmd_showstat, cmd_sinreg, cmd_slpline, cmd_sorta, cmd_sortd, cmd_toolbar, cmd_try, cmd_twovar, did_push_anti_deriv, push_1st_derivative, push_acosh, push_asin, push_asinh, push_atan, push_atanh, push_comdenom, push_cosh, push_csolve, push_czeros, push_def_int, push_desolve, push_determinant, push_exp, push_expand, push_extended_prod, push_factor, push_floor, push_lim, push_ln, push_log10, push_max, push_min, push_nsolve, push_red_row_ech, push_row_echelon, push_simult, push_sin2, push_sinh, push_solve, push_str_to_expr, push_summation, push_tan, push_tanh, push_zeros, push_dot_exponentiate, push_equals, push_exponentiate, push_greater_than, push_greater_than_or_equals, push_less_than, push_less_than_or_equals, push_not_equals, push_product, push_substitute_simplify, push_substitute_using_such_that, push_sum, Dialog, VarNew, VarSaveAs, display_statements, NG_approxESI, NG_execute, NG_graphESI, NG_rationalESI, NG_RPNToText, NG_tokenize, Parse1DExpr, Parse2DExpr, Parse2DMultiExpr, push_internal_simplify, push_parse_text, TokenizeSymName, EV_centralDispatcher, EV_defaultHandler, EV_sendEventSide, handleRclKey, handleVarLinkKey, MO_modeDialog, FOpen, GD_Text, GR3_paint3d, GR3_xyToWindow, gdb_recall, HomeExecute, HomePushEStack, HomeStorePair, LIO_Receive, OSLinkCmd, CTypeTable, atof, are_units_consistent, de_initRes, de_loop, did_push_approx_inflection_point, did_push_var_val, does_push_fetch, dv_create_graph_titles, EV_quit, execute_graph_func, get_ub, GetStatValue, GM_Derivative, GM_DistArc, GM_Inflection, GM_Integrate, GM_Intersect, GM_Math1, GM_Shade, GM_TanLine, gr_ck_solvergraph, gr_execute_de, gr_execute_seq, GR_Pan, GR3_addContours, GR3_handleEvent, GraphOrTableCmd, GT_CalcDepVals, GT_DE_Init_Conds, GT_DspTraceCoords, GT_Trace, GZ_Fit, index_if_pushed_qquad_info, InitTimeSeq, NG_setup_graph_fun, push_ans_entry, push_format, push_gcd_then_cofactors, push_make_proper, push_parse_prgm_or_func_text, push_simplify, push_sq_matrix_to_whole_number, push_user_func, recall_data_var, Regraph, replace_top_with_post_simplified, run_one_seq, seqWebInit, SP_Define, spike_in_editor, spike_optionD, spike_titles_in_editor, time_loop, tokenize_if_TI_92_or_text, VarStoreLink, FolderDel, FolderRename, HSymDel, SymFindFolderName, ROM Call 0x3CD, ROM Call 0x3F7, ROM Call 0x3F8, ROM Call 0x438, ROM Call 0x455, ROM Call 0x45B, ROM Call 0x45E, ROM Call 0x46F, ROM Call 0x486, ROM Call 0x494, ROM Call 0x495, ROM Call 0x4E6, ROM Call 0x5F1

See also: TRY, ONERR, ENDTRY, FINALLY, ENDFINAL, ER_throwVar, ER_throw, ER_success