From bbefa4241ddfe69ea6880b2dee74c2af167b5490 Mon Sep 17 00:00:00 2001 From: peterdeme Date: Thu, 26 May 2022 15:43:17 +0200 Subject: [PATCH] fix: ensure error response properly serialized --- src/StreamException.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/StreamException.cs b/src/StreamException.cs index 2600724..71b52c2 100644 --- a/src/StreamException.cs +++ b/src/StreamException.cs @@ -58,7 +58,7 @@ internal static StreamException FromResponse(RestResponse response) // {"code": 6, "detail": "The following feeds are not configured: 'secret'", "duration": "4ms", "exception": "FeedConfigException", "status_code": 400} ExceptionResponse state = null; - if (!string.IsNullOrWhiteSpace(response.Content)) + if (!string.IsNullOrWhiteSpace(response.Content) && response.Content.TrimStart().StartsWith("{")) { state = StreamJsonConverter.DeserializeObject(response.Content); }