{"id":16001197,"url":"https://github.com/gimenete/probot-report-error","last_synced_at":"2026-05-01T23:39:10.558Z","repository":{"id":66871358,"uuid":"138896744","full_name":"gimenete/probot-report-error","owner":"gimenete","description":"Something failed in your probot bot? No problem, probot-lifeguard will open a helpful issue","archived":false,"fork":false,"pushed_at":"2018-06-27T19:34:24.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-10T09:32:35.213Z","etag":null,"topics":["github","probot","probot-extension"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gimenete.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-27T14:58:48.000Z","updated_at":"2021-07-22T10:19:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"688d0f4d-9556-4423-87f2-05543dfc406b","html_url":"https://github.com/gimenete/probot-report-error","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gimenete%2Fprobot-report-error","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gimenete%2Fprobot-report-error/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gimenete%2Fprobot-report-error/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gimenete%2Fprobot-report-error/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gimenete","download_url":"https://codeload.github.com/gimenete/probot-report-error/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247272597,"owners_count":20911777,"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":["github","probot","probot-extension"],"created_at":"2024-10-08T09:40:40.126Z","updated_at":"2026-05-01T23:39:10.526Z","avatar_url":"https://github.com/gimenete.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# probot-report-error\n\n![Lifeguard](help.png \"Icon made by https://www.flaticon.com/authors/pixel-buddha from www.flaticon.com \")\n\nUse `probot-report-error` to catch errors in your probot app. `probot-report-error` will open\nan issue on your repo if something fails. For example if your app tries to load a config file\nand it is malformed.\n\n## Installing\n\n```\nnpm install gimenete/probot-report-error\n```\n\n## Usage\n\nYou can either wrap your entire app, just a single handler, or call the library manuall when there's\nan error. Wrapping the entire app is the easiest way but it internally modifies the probot instance\nwhich is not the most elegant solution, but it works perfectly.\n\n### Wrapping the entire app\n\nJust wrap your app in a call to `guard.guardApp()`. Example:\n\n```js\n// before\nmodule.exports = app =\u003e {\n  app.on('*', async context =\u003e {\n    app.log('Hey!')\n    await context.config('welcome.yml')\n  })\n};\n\n// after\nconst { lifeguard } = require('probot-report-error')\nconst guard = lifeguard({/* options here */})\n\nmodule.exports = guard.guardApp(app =\u003e {\n  app.on('*', async context =\u003e {\n    app.log('Hey!')\n    await context.config('welcome.yml')\n  })\n});\n```\n\n### Wrapping only one handler\n\nJust wrap your handler in a call to `guard.guardHandler()`. Example:\n\n```js\nconst { lifeguard } = require('probot-report-error')\nconst guard = lifeguard({/* options here */})\n\nmodule.exports = app =\u003e {\n  app.on('*', guard.guardHandler(async context =\u003e {\n    app.log('Hey!')\n    await context.config('welcome.yml')\n  }))\n});\n```\n\n### Calling the library directly\n\nJust call `reportError(context, error, [options])`.\n\n```js\nconst { reportError } = require('probot-report-error')\n\nmodule.exports = app =\u003e {\n  app.on('*', async context =\u003e {\n    try {\n      app.log('Hey!')\n      await context.config('welcome.yml')\n    } catch (err) {\n      return reportError(context, err, {/* options here */})\n    }\n  })\n});\n```\n\n## Options\n\nBoth the `lifeguard()` function and the `reportError()` functions support a few options. All of them are optional:\n\n| Option | Description | Default value | Example |\n| ------ | ----------- | ------------- | ------- |\n| `reopen`  | Lifeguard always checks if there's an existing issue for the error catched. If this option is set to `false` it looks for open issues and if there's not an open issue with the catched error it will create a new one. If set to `true` it will look for any issue and if it finds one but it's closed, it will reopen it | `false` | `true` |\n| `title`  | The title of the issue. It is always prefixed with a hash code that identifies the error | `Probot integration problem` | `Error while checking for stale issues` |\n| `body`  | The body of the issue. Besides this text the issue will contain more information about the error (e.g. the stacktrace if available) and the number of occurrences of the error | `An error occurred` | `Check the syntax of...` |\n| `labels`  | Array of labels to put in the issue. | `['devops']` | `[]` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgimenete%2Fprobot-report-error","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgimenete%2Fprobot-report-error","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgimenete%2Fprobot-report-error/lists"}