{"id":13496106,"url":"https://github.com/stein197/lua-catchify","last_synced_at":"2026-01-28T11:48:16.971Z","repository":{"id":135171041,"uuid":"433459387","full_name":"stein197/lua-catchify","owner":"stein197","description":"Tiny try-catch-finally statement for Lua","archived":false,"fork":false,"pushed_at":"2021-11-30T16:02:39.000Z","size":4,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-31T11:36:53.197Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","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/stein197.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-11-30T14:20:54.000Z","updated_at":"2022-10-24T11:05:13.000Z","dependencies_parsed_at":"2024-01-16T09:53:50.456Z","dependency_job_id":"e5dc3c4c-43a0-4703-abd1-67aa352c64c8","html_url":"https://github.com/stein197/lua-catchify","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stein197%2Flua-catchify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stein197%2Flua-catchify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stein197%2Flua-catchify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stein197%2Flua-catchify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stein197","download_url":"https://codeload.github.com/stein197/lua-catchify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246069869,"owners_count":20718804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-07-31T19:01:42.334Z","updated_at":"2026-01-28T11:48:16.930Z","avatar_url":"https://github.com/stein197.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# Tiny try-catch-finally implementation for Lua\n![](https://img.shields.io/github/license/stein197/lua-catchify)\n![](https://img.shields.io/github/v/tag/stein197/lua-catchify?label=Version)\n![](https://img.shields.io/luarocks/v/stein197/catchify)\n\nLua does not have a common syntax sugar to wrap the code that will possibly lead to errors. This package provides a very simple way to bring this sugar to Lua.\n\n## Installation\nVia LuaRocks:\n```\nluarocks install catchify\n```\nOr just download and require `init.lua` file from this repo.\n\n## Usage\nThe whole concept can be illustrated in a single code piece below:\n```lua\nlocal try = require \"catchify\"\ntry(function ()\n\terror \"Something's wrong!\"\nend):catch(function (e) -- e will contain error message\n\tprint(e) -- \u003e stdin:3: Something's wrong!\nend):finally(function () -- Will be executed anyway\n\tprint \"Finally here!\"\nend)\n```\n\nYou can pass a table containing single function instead of a function to make syntax more \"curly\":\n```lua\ntry {\n\tfunction ()\n\t\terror \"Something's wrong!\"\n\tend\n} :catch {\n\tfunction (e)\n\t\tprint(e)\n\tend\n} :finally {\n\tfunction ()\n\t\tprint \"Finally here!\"\n\tend\n}\n```\n\n## Testing\nInstall luaunit package:\n```\nluarocks install luaunit\n```\nThen run from the console:\n```\nlua test.lua\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstein197%2Flua-catchify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstein197%2Flua-catchify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstein197%2Flua-catchify/lists"}