Added EMVCActiveRecordValidationError for "storage related" exception. Is not intended to be used for general validation.

This commit is contained in:
Daniele Teti 2024-11-08 12:34:34 +01:00
parent 2c404c6efa
commit 00c095d090

View File

@ -61,6 +61,15 @@ type
procedure AfterConstruction; override;
end;
EMVCActiveRecordValidationError = class(EMVCActiveRecord)
private
fPropertyName: String;
public
procedure AfterConstruction; override;
constructor Create(const PropertyName: String; const ValidationError: string);
property PropertyName: String read fPropertyName;
end;
EMVCActiveRecordVersionedItemNotFound = class(EMVCActiveRecordNotFound)
end;
@ -4832,6 +4841,20 @@ end;
{$ENDIF}
{ EMVCActiveRecordValidation }
procedure EMVCActiveRecordValidationError.AfterConstruction;
begin
inherited;
FHTTPStatusCode := HTTP_STATUS.BadRequest;
end;
constructor EMVCActiveRecordValidationError.Create(const PropertyName, ValidationError: string);
begin
inherited Create(ValidationError);
fPropertyName := PropertyName;
end;
initialization
gTableMapLock := TObject.Create;