Skip to content

Commit 498b5f3

Browse files
Merge pull request #18 from antoniojmsjr/master
Hotfix: Ajuste para compilação Lazarus.
2 parents 2996140 + 567f8d7 commit 498b5f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Src/Horse.HandleException.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ procedure HandleException(Req: THorseRequest; Res: THorseResponse; Next: {$IF DE
4242
raise;
4343
on E: EHorseException do
4444
begin
45-
LJSON := TJSONObject.ParseJSONValue(E.ToJSON) as TJSONObject;
45+
LJSON := {$IF DEFINED(FPC)}GetJSON(E.ToJSON) as TJSONObject{$ELSE}TJSONObject.ParseJSONValue(E.ToJSON) as TJSONObject{$ENDIF};
4646
SendError(Res, LJSON, Integer(E.Status));
4747
end;
4848
on E: Exception do
4949
begin
5050
LStatus := Res.Status;
51-
if LStatus < Integer(THTTPStatus.BadRequest) then
51+
if (LStatus < Integer(THTTPStatus.BadRequest)) then
5252
LStatus := Integer(THTTPStatus.InternalServerError);
5353
LJSON := TJSONObject.Create;
5454
LJSON.{$IF DEFINED(FPC)}Add{$ELSE}AddPair{$ENDIF}('error', E.Message);

0 commit comments

Comments
 (0)