mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
Added EMVCActiveRecordValidationError for "storage related" exception. Is not intended to be used for general validation.
This commit is contained in:
parent
2c404c6efa
commit
00c095d090
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user