{"id":37030653,"url":"https://github.com/futurum-dev/dotnet.futurum.core.polly","last_synced_at":"2026-01-14T03:44:20.260Z","repository":{"id":44587411,"uuid":"454916673","full_name":"futurum-dev/dotnet.futurum.core.polly","owner":"futurum-dev","description":"Small dotnet library, allowing you to use Polly with Futurum.Core, based on the concepts behind 'Railway Oriented Programming'.","archived":false,"fork":false,"pushed_at":"2023-04-07T12:19:45.000Z","size":65,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-01T01:41:44.367Z","etag":null,"topics":["csharp","dotnet","functional-programming","polly","polly-resilience","railway-oriented-programming","result-type"],"latest_commit_sha":null,"homepage":"https://docs.futurum.dev/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/futurum-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-02T20:00:00.000Z","updated_at":"2023-04-07T12:22:06.000Z","dependencies_parsed_at":"2023-01-23T04:01:25.965Z","dependency_job_id":null,"html_url":"https://github.com/futurum-dev/dotnet.futurum.core.polly","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/futurum-dev/dotnet.futurum.core.polly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurum-dev%2Fdotnet.futurum.core.polly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurum-dev%2Fdotnet.futurum.core.polly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurum-dev%2Fdotnet.futurum.core.polly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurum-dev%2Fdotnet.futurum.core.polly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/futurum-dev","download_url":"https://codeload.github.com/futurum-dev/dotnet.futurum.core.polly/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurum-dev%2Fdotnet.futurum.core.polly/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","functional-programming","polly","polly-resilience","railway-oriented-programming","result-type"],"created_at":"2026-01-14T03:44:19.783Z","updated_at":"2026-01-14T03:44:20.247Z","avatar_url":"https://github.com/futurum-dev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Futurum.Core.Polly\n\n![license](https://img.shields.io/github/license/futurum-dev/dotnet.futurum.core?style=for-the-badge)\n![CI](https://img.shields.io/github/actions/workflow/status/futurum-dev/dotnet.futurum.core.polly/ci.yml?branch=main\u0026style=for-the-badge)\n[![Coverage Status](https://img.shields.io/coveralls/github/futurum-dev/dotnet.futurum.core.polly?style=for-the-badge)](https://coveralls.io/github/futurum-dev/dotnet.futurum.core.polly?branch=main)\n[![NuGet version](https://img.shields.io/nuget/v/futurum.core.polly?style=for-the-badge)](https://www.nuget.org/packages/futurum.core.polly)\n\nSmall dotnet library, allowing you to use [Polly](https://github.com/App-vNext/Polly) with Futurum.Core, based on the concepts behind 'Railway Oriented Programming'.\n\n### Try\nTry to run func, using the Polly policy. If the policy fails, the failing result will be returned as a failure.\n\n```csharp\nvar result = await ResultPolly.TryAsync(func, () =\u003e ERROR_MESSAGE, pollyPolicy);\n```\n\n### ThenTry\nCombines Result.Then with ResultPolly.Try\n\n```csharp\nvar outputResult = await inputResult.ThenTryAsync(func, () =\u003e ERROR_MESSAGE, pollyPolicy);\n```\n\n### HandleResult\nCreate a policy to handle Result\n\n```csharp\nPolicy.Handle\u003cException\u003e()\n      .HandleResult()\n```\n\n### HandleResult\u0026lt;T\u0026gt;\nCreate a policy to handle Result\u0026lt;T\u0026gt;\n\n```csharp\nPolicy.Handle\u003cException\u003e()\n      .HandleResult\u003cstring\u003e()\n```\n\n### DelegateResult extensions\n#### GetErrorMessage\n\nGet the error message either from the Exception or the Result / Result\u0026lt;T\u0026gt;\n\n```csharp\nvar errorMessage = delegateResult.GetErrorMessage()\n```\n\n```csharp\n_pollyPolicy = Policy.Handle\u003cException\u003e()\n                     .HandleResult\u003cstring\u003e()\n                     .WaitAndRetryAsync(new []{TimeSpan.FromSeconds(5), },\n                                        (delegateResult, timeSpan, retryCount, context) =\u003e\n                                        {\n                                            var error = delegateResult.GetErrorMessage();\n                                            \n                                            _logger.LogWarning(\"Retry - retryCount: '{RetryCount}'. Error : '{Error}'\", retryCount, error);\n                                        });\n```\n\n#### DelegateResult GetErrorMessageSafe\nGet the safe error message either from the Exception or the Result / Result\u0026lt;T\u0026gt;\n\n```csharp\nvar errorMessage = delegateResult.GetErrorMessageSafe()\n```\n\n```csharp\n_pollyPolicy = Policy.Handle\u003cException\u003e()\n                     .HandleResult\u003cstring\u003e()\n                     .WaitAndRetryAsync(new []{TimeSpan.FromSeconds(5), },\n                                        (delegateResult, timeSpan, retryCount, context) =\u003e\n                                        {\n                                            var error = delegateResult.GetErrorMessageSafe();\n                                            \n                                            _logger.LogWarning(\"Retry - retryCount: '{RetryCount}'. Error : '{Error}'\", retryCount, error);\n                                        });\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuturum-dev%2Fdotnet.futurum.core.polly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuturum-dev%2Fdotnet.futurum.core.polly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuturum-dev%2Fdotnet.futurum.core.polly/lists"}