From ae5afe8914b16959e9bbd62fe74254e81fe9cbe2 Mon Sep 17 00:00:00 2001 From: Jeroen Bobbeldijk Date: Tue, 12 May 2020 06:49:45 +0200 Subject: [PATCH] Always try to parse request so we also have data on request errors --- .../Activities/ParseDocumentActivity.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/KlippaOCRAPI/Activities/ParseDocumentActivity.cs b/KlippaOCRAPI/Activities/ParseDocumentActivity.cs index a8edba8..1d6eca0 100644 --- a/KlippaOCRAPI/Activities/ParseDocumentActivity.cs +++ b/KlippaOCRAPI/Activities/ParseDocumentActivity.cs @@ -129,17 +129,14 @@ protected override void EndExecute(AsyncCodeActivityContext context, IAsyncResul HTTPResponseHeaders.Set(context, response.Headers); RequestSuccesful.Set(context, requestSuccesful); - if (requestSuccesful) + try { - try - { - APIResponse deserializedAPIResponse = JsonConvert.DeserializeObject(output); - APIResponse.Set(context, deserializedAPIResponse); - } - catch (Exception) - { - - } + APIResponse deserializedAPIResponse = JsonConvert.DeserializeObject(output); + APIResponse.Set(context, deserializedAPIResponse); + } + catch (Exception) + { + } } catch (OperationCanceledException)