Skip to content

Commit

Permalink
Better exception error messages for mid-air edit collision
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleteti committed Jul 28, 2024
1 parent 2e05917 commit 2732dd9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sources/MVCFramework.RESTAdapter.pas
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ procedure TRESTAdapter<T>.DoInvoke(aMethod: TRttiMethod; const aArgs: TArray<TVa
lResp := fRESTClient.Head(lURL);
else
begin
raise Exception.Create('Error Message');
raise Exception.Create('Invalid HTTP method');
end;
end;

Expand Down
2 changes: 1 addition & 1 deletion sources/MVCFramework.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3984,7 +3984,7 @@ procedure TMVCController.CheckIfMatch(const Data: String);

if lReqETag <> GetSHA1HashFromString(Data) then
begin
raise EMVCException.Create(HTTP_STATUS.PreconditionFailed, 'mid-air collisions detected, cannot update or delete resource.');
raise EMVCException.Create(HTTP_STATUS.PreconditionFailed, 'mid-air collisions detected (invalid "if-match" value), cannot update or delete resource.');
end;
end;

Expand Down

0 comments on commit 2732dd9

Please sign in to comment.