{"id":13828399,"url":"https://github.com/paragonie/corner","last_synced_at":"2025-06-17T01:36:28.489Z","repository":{"id":57035869,"uuid":"162546573","full_name":"paragonie/corner","owner":"paragonie","description":"Exceptions and Errors made more user-friendly","archived":false,"fork":false,"pushed_at":"2020-12-03T15:05:40.000Z","size":15,"stargazers_count":62,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-05T20:52:24.829Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paragonie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-20T08:03:47.000Z","updated_at":"2024-02-27T13:41:37.000Z","dependencies_parsed_at":"2022-08-23T20:50:59.457Z","dependency_job_id":null,"html_url":"https://github.com/paragonie/corner","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fcorner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fcorner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fcorner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fcorner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paragonie","download_url":"https://codeload.github.com/paragonie/corner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fcorner/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258968529,"owners_count":22785923,"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-08-04T09:02:44.724Z","updated_at":"2025-06-17T01:36:28.451Z","avatar_url":"https://github.com/paragonie.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Corner\n\n[![Linux Build Status](https://travis-ci.org/paragonie/corner.svg?branch=master)](https://travis-ci.org/paragonie/corner)\n[![Latest Stable Version](https://poser.pugx.org/paragonie/corner/v/stable)](https://packagist.org/packages/paragonie/corner)\n[![Latest Unstable Version](https://poser.pugx.org/paragonie/corner/v/unstable)](https://packagist.org/packages/paragonie/corner)\n[![License](https://poser.pugx.org/paragonie/corner/license)](https://packagist.org/packages/paragonie/corner)\n[![Downloads](https://img.shields.io/packagist/dt/paragonie/corner.svg)](https://packagist.org/packages/paragonie/corner)\n\nPHP Exceptions and Errors designed to prevent your users from sharp corners.\nInspired by [Rust's helpful error messages](https://twitter.com/acfoltzer/status/1074813646625169408).\n\n* Version 2.x: **Requires PHP 7.1 or newer.**\n* Version 1.x: Requires PHP 5.4 or newer.\n\n## Motivation \n\nThere are already libraries like [Whoops](https://github.com/filp/whoops) which\nfocus on taking existing uncaught Exceptions and giving them a user interface.\n\nRather than take control of your entire UI output, Corner extends the base\n`Throwable` interface and `Exception`/`Error` classes and makes them more useful\neven in non-UI contexts.\n\n## Corner's Extended Exception API\n\n### `getHelpfulMessage()`\n\n\u003e What *exactly* is going on here?\n\nImagine an email. `Throwable::getMessage()` can be likened to the\nsubject line. In traditional exceptions, the closest thing you have\nto a message body is `getTraceAsString()`.\n\nIn Corner, the \"helpful message\" is meant to be a full-text explanation\nof the problem. ASCII art diagrams (hard-coded or generated from the\nsource code, if applicable) are permitted.\n\n### `getSnippet($before = 0, $after = 0, $traceWalk = 0)`\n\n\u003e What was the code surrounding the exception doing?\n\nBy default, this returns the line of PHP code that triggered the exception.\n\nYou can optionally pass a number of leading and trailing lines to this method\nto read more text from the source code file. The third argument allows you\nto excerpt snippets of code from within the stack trace.\n\nThe main use case for `getSnippet()` is to generate helpful error messages\nfor `getHelpfulMessage()`.\n\n### `getSupportLink()`\n\n\u003e Where can I find help?\n\nThe intent of this method is to give the developer using your project the\nquickest possible path to troubleshooting and solving the problem that\nthey're most likely facing if this Exception / Error gets thrown.\n\nIf possible, link to a specific section of your project's documentation\n(including page anchors, if applicable) to get the developer closer to\nthe solution to whatever problem they're encountering.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparagonie%2Fcorner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparagonie%2Fcorner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparagonie%2Fcorner/lists"}