From 2732dd998a8a5ef075de6a7224170da5375bb1c6 Mon Sep 17 00:00:00 2001 From: Daniele Teti Date: Sun, 28 Jul 2024 23:26:04 +0200 Subject: [PATCH] Better exception error messages for mid-air edit collision --- sources/MVCFramework.RESTAdapter.pas | 2 +- sources/MVCFramework.pas | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/MVCFramework.RESTAdapter.pas b/sources/MVCFramework.RESTAdapter.pas index 297152ec..69c85df0 100644 --- a/sources/MVCFramework.RESTAdapter.pas +++ b/sources/MVCFramework.RESTAdapter.pas @@ -272,7 +272,7 @@ begin lResp := fRESTClient.Head(lURL); else begin - raise Exception.Create('Error Message'); + raise Exception.Create('Invalid HTTP method'); end; end; diff --git a/sources/MVCFramework.pas b/sources/MVCFramework.pas index 0e570f52..c6684526 100644 --- a/sources/MVCFramework.pas +++ b/sources/MVCFramework.pas @@ -3984,7 +3984,7 @@ begin 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;