{"id":30207716,"url":"https://github.com/cbrt-x/try-catch-wrapper","last_synced_at":"2026-04-17T06:32:41.987Z","repository":{"id":41855323,"uuid":"484814818","full_name":"cbrt-x/try-catch-wrapper","owner":"cbrt-x","description":"A wrapper for a Try-catch block in Java, providing useful methods to obtain values from the block","archived":false,"fork":false,"pushed_at":"2022-08-03T09:48:44.000Z","size":39,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T22:14:26.695Z","etag":null,"topics":["java","lambda-expressions","library","maven","try-catch","try-catch-finally","wrapper","wrapper-library"],"latest_commit_sha":null,"homepage":"","language":"Java","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/cbrt-x.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-04-23T17:35:51.000Z","updated_at":"2022-11-27T00:23:13.000Z","dependencies_parsed_at":"2022-08-24T00:40:23.028Z","dependency_job_id":null,"html_url":"https://github.com/cbrt-x/try-catch-wrapper","commit_stats":null,"previous_names":["celestial-gemstone/try-catch-wrapper","cbrt-x/try-catch-wrapper"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/cbrt-x/try-catch-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrt-x%2Ftry-catch-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrt-x%2Ftry-catch-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrt-x%2Ftry-catch-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrt-x%2Ftry-catch-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbrt-x","download_url":"https://codeload.github.com/cbrt-x/try-catch-wrapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrt-x%2Ftry-catch-wrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31918486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"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":["java","lambda-expressions","library","maven","try-catch","try-catch-finally","wrapper","wrapper-library"],"created_at":"2025-08-13T16:35:05.121Z","updated_at":"2026-04-17T06:32:41.938Z","avatar_url":"https://github.com/cbrt-x.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Download via [Jitpack](https://jitpack.io/#Jadefalke2/Try-Catch-Wrapper/v1.0.0)\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ejitpack.io\u003c/id\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.Jadefalke256\u003c/groupId\u003e\n    \u003cartifactId\u003eTry-Catch-Wrapper\u003c/artifactId\u003e\n    \u003cversion\u003ev1.0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n# Usage\n### Run method\n```java\nTry.attempt(this::executeMethod)\n\t.onCatch(Throwable::printStacktrace)\n\t.run();\n```\n### Obtain value from method call\n```java\nvar files = Try.attempt(() -\u003e Files.list(path))\n    .onCatch(IOException.class, Throwable::printStacktrace)\n    .obtain();\n\nfiles.ifPresent(this::doSomething);\n```\n### Use `finally`\n```java\nTry.attempt(this::startProcess)\n    .onFinally(this::endProcess);\n    .run();\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbrt-x%2Ftry-catch-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbrt-x%2Ftry-catch-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbrt-x%2Ftry-catch-wrapper/lists"}