private void processError(Exception exception, PaymentRequest request) { log.TryLogOnException(() => { var response = request.GenerateResponse(); response.ResponseType = PaymentResponse.Type.Error; response.Error = $"An error has occured with the [{request.RequestType}] request. See the log and contact the support."; send(response); }); }
private async Task handleMessage(PaymentRequest request) { var context = mposBridge.GetContext(request.ContextId); var response = request.GenerateResponse(); if (context == null) { var message = "Error on creating context"; log.Me.Info(message); response.ResponseType = PaymentResponse.Type.Error; response.Error = message; } else { log.Me.Info(request.RequestType); await handleRequest(context, request, response); } send(response); }