| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > FileManager > FileManager Methods >====== SetError (save the specified error and underlying error state) {{c6h0009.jpg|C6H0009.jpg}} ====== | [[savefile save the current file state .htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[seterrors set the error class used .htm|{{btn_next_n.gif|Next page}}]] | | || **SetError( **//error id //**)** {{blk2blue.jpg|blk2blue.jpg}} | **SetError** | Saves the specified error and the underlying error state for use by the Throw method, etc. | | //error id// | A numeric constant, variable, EQUATE, or expression that identifies the error. See //Error Class// for more information on error id. | The **SetError **method saves the specified error and underlying error state for use by the Throw method, etc. **Example:** **Access:Client.Next FUNCTION(BYTE HandleError) !Next function** ** CODE                                        !with alternative error handling** ** LOOP** **  NEXT( SELF.File )                          !get the next record** **  CASE ERRORCODE()                           !check for error conditions** **  OF BadRecErr OROF NoError** **   RETURN Level:Benign** **  OF IsHeldErr                               !if record is HELD by another** **   SELF.SetError(Msg:RecordHeld)             !make RecordHeld the current error** **   IF HandleError                            !if interactive error handling** **    RETURN SELF.Throw()                      !pass current error to error handler** **   ELSE                                      !otherwise (silent error handling)** **    RETURN Level:Notify                      !return error code to caller** **   END** **  END** ** END** **See Also:**     [[throw pass an error to the error handler for processing .htm|Throw]]