Skip to content

Commit d3a2c04

Browse files
Merge pull request #6 from rmotafacundo/request
Atributo type só será retornado se for diferente de Error
2 parents a86a7d8 + 8fa8099 commit d3a2c04

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)