dev • api • name • gb.error

GB.Error

void * GB.Error ( const char * error , ... )

Tells the interpreter that the current method or property must raise an error.

  • error is a text describing the error. This text can contain substitution patterns : each '&n' pattern, n being in the 1...9 interval, will be replaced by the n/th optional argument of GB.Error.

This functions does not send any exception. You must return explicitely after calling GB.Error if you want to abort the method or property.

Examples

/ * This comes From the implementation Of Table.Fields.Find In the database component * /

BEGIN_METHOD(CFIELD_find, GB_STRING name)

  ...

  If (THIS - > Create
      || !THIS->driver->Field.Exist(THIS->db->handle, THIS->table, field))
  {
    GB.Error("Unknown field: &1.&2", THIS - > table, field);
    Return ;
  }

  ...

END_METHOD