{"id":18888077,"url":"https://github.com/codex-team/hawk.android.catcher","last_synced_at":"2025-04-14T23:10:54.193Z","repository":{"id":46230928,"uuid":"107898635","full_name":"codex-team/hawk.android.catcher","owner":"codex-team","description":"Android errors Catcher module for Hawk.so","archived":false,"fork":false,"pushed_at":"2021-11-25T20:29:42.000Z","size":1436,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-28T11:11:39.024Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/codex-team.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":"2017-10-22T20:05:12.000Z","updated_at":"2021-11-17T01:05:23.000Z","dependencies_parsed_at":"2022-09-19T07:30:51.976Z","dependency_job_id":null,"html_url":"https://github.com/codex-team/hawk.android.catcher","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fhawk.android.catcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fhawk.android.catcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fhawk.android.catcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fhawk.android.catcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codex-team","download_url":"https://codeload.github.com/codex-team/hawk.android.catcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975316,"owners_count":21192210,"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-11-08T07:42:04.301Z","updated_at":"2025-04-14T23:10:54.174Z","avatar_url":"https://github.com/codex-team.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hawk Android catcher [![](https://jitpack.io/v/codex-team/hawk.android.catcher.svg)](https://jitpack.io/#codex-team/hawk.android.catcher)\n### Exception catcher\n\nThis library provides in-app errors catching and sending them to the [Hawk](https://hawk.so).  monitoring system.\nYou can also send errors, which you caught in **try-catch**.\n\n**Minimum required Android SDK 16**\n\n-----\n\n### Connection\nTo connect the library, add the following code to your **build.gradle** config.\n```\n    allprojects {\n        repositories {\n            jcenter()\n            maven { url \"https://jitpack.io\" }\n        }\n   }\n   ...\n   dependencies {\n        implementation 'com.github.codex-team:hawk.android.catcher:v3.0'\n   }\n```\n### Example\nFor cather activation add following code to your manifest (f.e. **UseSample**)\n\n```xml\n\u003cmanifest\u003e\n    \u003capplication\u003e\n        \u003cmeta-data android:name=\"hawk_catcher_token\" android:value=\"TOKEN\"/\u003e\n    \u003c/application\u003e\n\n\u003c/manifest\u003e\n```\n\n**Parameters**\n\n\u003e **TOKEN** - unique authorization key. You can get token after garage.hawk.so registration\n\nand to you application class\n\n```java\npublic class UseSampleApp extends Application {\n\n    public HawkExceptionCatcher exceptionCatcher;\n    public void defineExceptionCather()\n    {\n        exceptionCatcher = new HawkExceptionCatcher(this);\n        exceptionCatcher.start();\n    }\n    @Override\n    public void onCreate() {\n        super.onCreate();\n        defineExceptionCather();\n    }\n}\n```\n**Input parameters** \n\n\u003e **Context** - current application context\n\n## Example  \n\nCatching **UncheckedException**\n\n```java\nvoid myTask() {\n\tint d = 10 / 0;\n}\n...\nmyTask();\n```\nCaught exception will be send with **JSON** format \n\nSending handled exceptions\n\n```java\nvoid myTask() {\n    try {\n        int d = 10 / 0;\n    } catch(ArithmeticException e) {\n        UseSampleApp.exceptionCatcher.caught(e);\n        //This method sends an exception with JSON-format\n    }\n}\n...\nmyTask();\n```\n\nWherein, without using the function **log()** in the **try-catch**, the error won't be sent.\n\n```java\nvoid myTask() {\n    try {\n        int d = 10 / 0;\n    } catch(ArithmeticException e) {\n        e.printStackTrace();\n        //The exception won't be sent\n    }\n}\n...\nmyTask();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Fhawk.android.catcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodex-team%2Fhawk.android.catcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Fhawk.android.catcher/lists"}