Пример #1
0
        private void ProviderKeysHandler(ProviderKeysRequestMessage request)
        {
            Log("Saving keys...");
            var success = true;

            try
            {
                _apiKeyService.SaveKeys(request.Id, request.Key, request.Secret, request.Extra);
            }
            catch (Exception e)
            {
                success = false;
                Log($"Error while saving keys: {e.Message}");
            }

            M.SendAsync(new ProviderKeysResponseMessage(request, success));
        }
Пример #2
0
        private void ProviderKeysHandler(ProviderSaveKeysRequestMessage request)
        {
            Log("Saving keys...");
            ProviderSaveKeysResponseMessage msg;

            try
            {
                _apiKeyService.SaveKeys(request.Id, request.Key, request.Secret, request.Extra);

                msg = new ProviderSaveKeysResponseMessage(request, true);
            }
            catch (Exception e)
            {
                Log($"Error while saving keys: {e.Message}");

                msg = new ProviderSaveKeysResponseMessage(request, false, e.Message);
            }

            M.SendAsync(msg);
        }