Exemple #1
0
        public async Task <(JsonRpc response, string error)> PostAsync(JsonRpc request, CancellationToken cancellation)
        {
            try
            {
                if (JsonRpc.TryParse(await provider.PostAsync(request, cancellation), out JsonRpc response))
                {
                    if (response.HasError)
                    {
                        return(null, response.ErrorMessage);
                    }

                    return(response, null);
                }

                return(null, "response not parsable");
            }
            catch (Exception ex)
            {
                return(null, ex.Message);
            }
        }