| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > FileManager > FileManager Methods >====== Throw (pass an error to the error handler for processing) {{c6h0009.jpg|C6H0009.jpg}} ====== | [[setusemrp set usemrp value fm.htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[throwmessage pass an error and text to the error handler .htm|{{btn_next_n.gif|Next page}}]] | | || **Throw( **[//error id//]// //**), VIRTUAL, PROC** {{blk2blue.jpg|blk2blue.jpg}} | **Throw** | Passes the specified error to the error handler object for processing. | | //error id// | A numeric constant, variable, EQUATE, or expression that indicates the error to process. If omitted, Throw processes the current error--that is , the error identified by the previous call to SetError or Throw. | The **Throw **method passes the current (last encountered) error to the nominated error handler for processing, including FILEERROR() and FILEERRORCODE() values, then returns the severity level of the error. **Implementation:** The SetError method saves the specified error and underlying error state for use by the Throw method. See //Error Class// for more information on error ids and severity levels. The Init method receives and sets the error handler object. **Return Data Type:**     BYTE **Example:** **Access:Client.Next FUNCTION(BYTE HandleError)!Next function** ** CODE                                        !with alternative error handling** ** LOOP** **  NEXT( SELF.File )                          !get the next record** **  CASE ERRORCOD()                            !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: **[[init initialize the filemanager object .htm|Init]], [[seterror save the specified error and underlying error state .htm|SetError]]