Skip to content

Commit

Permalink
Added logging when test request fails
Browse files Browse the repository at this point in the history
  • Loading branch information
TSchmiedlechner committed May 12, 2021
1 parent 62638d5 commit b3a1ce8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/fiskaltrust.AndroidLauncher.Grpc/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
using Newtonsoft.Json;
using fiskaltrust.ifPOS.v1;
using Android.Widget;
using Android.Util;
using fiskaltrust.AndroidLauncher.Common.Helpers.Logging;

namespace fiskaltrust.AndroidLauncher.Grpc
{
Expand Down Expand Up @@ -52,8 +54,9 @@ public string SendEchoTestBackdoor(string url, string message)
var pos = Task.Run(() => GrpcPosFactory.CreatePosAsync(new GrpcClientOptions { Url = new Uri(url), RetryPolicyOptions = null })).Result;
return Task.Run(() => pos.EchoAsync(new ifPOS.v1.EchoRequest { Message = message })).Result.Message;
}
catch
catch (Exception ex)
{
Log.Error(AndroidLogger.TAG, ex.ToString());
return string.Empty;
}
}
Expand All @@ -68,8 +71,9 @@ public string SendSignTestBackdoor(string url, string signRequest)

return JsonConvert.SerializeObject(response);
}
catch
catch (Exception ex)
{
Log.Error(AndroidLogger.TAG, ex.ToString());
return string.Empty;
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/fiskaltrust.AndroidLauncher.Http/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
using System.Threading.Tasks;
using Newtonsoft.Json;
using fiskaltrust.ifPOS.v1;
using Android.Util;
using fiskaltrust.AndroidLauncher.Common.Helpers.Logging;

namespace fiskaltrust.AndroidLauncher.Http
{
Expand Down Expand Up @@ -53,8 +55,9 @@ public string SendEchoTestBackdoor(string url, string message)
var pos = Task.Run(() => HttpPosFactory.CreatePosAsync(new HttpPosClientOptions { Url = new Uri(url), RetryPolicyOptions = null })).Result;
return Task.Run(() => pos.EchoAsync(new ifPOS.v1.EchoRequest { Message = message })).Result.Message;
}
catch
catch (Exception ex)
{
Log.Error(AndroidLogger.TAG, ex.ToString());
return string.Empty;
}
}
Expand All @@ -69,8 +72,9 @@ public string SendSignTestBackdoor(string url, string signRequest)

return JsonConvert.SerializeObject(response);
}
catch
catch (Exception ex)
{
Log.Error(AndroidLogger.TAG, ex.ToString());
return string.Empty;
}
}
Expand Down

0 comments on commit b3a1ce8

Please sign in to comment.