RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TAdapterErrorsList.AddError Method (Exception, TObject)

Adds an error to the list.

Pascal
procedure AddError(AException: Exception; const AObjectName: string = ''); override;
procedure AddError(const AMessage: string; const AObjectName: string = ''; AID: Integer = 0); override;
procedure AddError(const AMessage: string; AObject: TObject; AID: Integer = 0); override;
procedure AddError(AException: Exception; AObject: TObject); override;
C++
virtual __fastcall AddError(Exception AException, const AnsiString AObjectName = '');
virtual __fastcall AddError(const AnsiString AMessage, const AnsiString AObjectName = '', int AID = 0);
virtual __fastcall AddError(const AnsiString AMessage, TObject * AObject, int AID = 0);
virtual __fastcall AddError(Exception AException, TObject * AObject);

AddError adds an error to the object's internal list. An error is described by three pieces of information: 

An error message string. You can specify this string directly with the AMessage parameter, or using an Exception object (with the AException parameter). If you specify an Exception object, the object's Message property becomes the message string. 

The name of an object (Variable) related to the error. You can specify this value as a string (with the AObjectName parameter) or as an object reference (with the AObject parameter). If you omit both these parameters, but supply an EAdapterFieldException object as the AException parameter, TAdapterErrorsList uses the FieldName property of that exception object. If you do not supply an AObject parameter, an AObjectName parameter, or an EAdapterFIeldException object as the AException parameter, TAdapterErrorsList uses an empty string. 

An error ID value. You can specify this value using the AID parameter. If you do not supply a value for AID but specify an EAdapterException object as the AException parameter, TAdapterErrorsList uses the ID property of that exception object. If you do not supply an AID parameter or an EAdapterException object, TAdapterErrorsList uses 0. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!