Skip to content

Commit 8fa8099

Browse files
committed
Atributo type só será retornado se for diferente de Error
1 parent a86a7d8 commit 8fa8099

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Src/Horse.HandleException.pas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ procedure HandleException(Req: THorseRequest; Res: THorseResponse; Next: {$IF DE
5858
LJSON.{$IF DEFINED(FPC)}Add{$ELSE}AddPair{$ENDIF}('code', {$IF DEFINED(FPC)}TJSONIntegerNumber{$ELSE}TJSONNumber{$ENDIF}.Create(E.Code));
5959
end;
6060

61-
LJSON.{$IF DEFINED(FPC)}Add{$ELSE}AddPair{$ENDIF}('type', GetEnumName(TypeInfo(TMessageType), Integer(E.&Type)));
61+
if E.&Type <> TMessageType.Error then
62+
begin
63+
LJSON.{$IF DEFINED(FPC)}Add{$ELSE}AddPair{$ENDIF}('type', GetEnumName(TypeInfo(TMessageType), Integer(E.&Type)));
64+
end;
6265

6366
SendError(Res, LJSON, E.Code);
6467
end;

0 commit comments

Comments
 (0)