{"id":15604127,"url":"https://github.com/tanersener/smart-exception","last_synced_at":"2025-10-28T00:35:06.787Z","repository":{"id":39616078,"uuid":"223775816","full_name":"tanersener/smart-exception","owner":"tanersener","description":"Utilities to handle throwable objects and format stack trace elements in JVM based languages (Java, Scala, Kotlin, Groovy, etc.)","archived":false,"fork":false,"pushed_at":"2022-05-30T22:11:42.000Z","size":228,"stargazers_count":35,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-20T07:51:36.467Z","etag":null,"topics":["android","exception-handling","groovy","java","kotlin","scala"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tanersener.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":"2019-11-24T16:37:39.000Z","updated_at":"2025-10-07T08:35:39.000Z","dependencies_parsed_at":"2022-09-05T18:12:53.301Z","dependency_job_id":null,"html_url":"https://github.com/tanersener/smart-exception","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tanersener/smart-exception","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanersener%2Fsmart-exception","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanersener%2Fsmart-exception/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanersener%2Fsmart-exception/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanersener%2Fsmart-exception/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tanersener","download_url":"https://codeload.github.com/tanersener/smart-exception/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanersener%2Fsmart-exception/sbom","scorecard":{"id":867633,"data":{"date":"2025-08-11","repo":{"name":"github.com/tanersener/smart-exception","commit":"124a36ff9bab80dd7c22967e4b7485295d092c12"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/6 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/tanersener/smart-exception/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/tanersener/smart-exception/build.yml/main?enable=pin","Warn: containerImage not pinned by hash: test/logback/docker-compose/fluentd/Dockerfile:3: pin your Docker image by updating fluent/fluentd:v1.6-debian-1 to fluent/fluentd:v1.6-debian-1@sha256:7e66e105207aec43b36db0d4f07ad5a4bd18ba35cbb5fc530b1202e23d42f0bb","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.2.1 not signed: https://api.github.com/repos/tanersener/smart-exception/releases/68189323","Warn: release artifact v0.2.0 not signed: https://api.github.com/repos/tanersener/smart-exception/releases/61708489","Warn: release artifact v0.1.1 not signed: https://api.github.com/repos/tanersener/smart-exception/releases/54205625","Warn: release artifact v0.1.0 not signed: https://api.github.com/repos/tanersener/smart-exception/releases/25467479","Warn: release artifact v0.2.1 does not have provenance: https://api.github.com/repos/tanersener/smart-exception/releases/68189323","Warn: release artifact v0.2.0 does not have provenance: https://api.github.com/repos/tanersener/smart-exception/releases/61708489","Warn: release artifact v0.1.1 does not have provenance: https://api.github.com/repos/tanersener/smart-exception/releases/54205625","Warn: release artifact v0.1.0 does not have provenance: https://api.github.com/repos/tanersener/smart-exception/releases/25467479"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T03:07:17.814Z","repository_id":39616078,"created_at":"2025-08-24T03:07:17.814Z","updated_at":"2025-08-24T03:07:17.814Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281366887,"owners_count":26488695,"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","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"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":["android","exception-handling","groovy","java","kotlin","scala"],"created_at":"2024-10-03T03:33:13.576Z","updated_at":"2025-10-28T00:35:06.754Z","avatar_url":"https://github.com/tanersener.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SmartException ![GitHub release](https://img.shields.io/badge/release-v0.2.1-blue.svg) ![Maven Central](https://img.shields.io/maven-central/v/com.arthenica/smart-exception-java) ![build status](https://github.com/tanersener/smart-exception/actions/workflows/build.yml/badge.svg)\n\nUtilities to handle throwable objects and format stack trace elements in `JVM` based languages (`Java`, `Scala`, `Kotlin`, `Groovy`, etc.)\n\n\u003cimg src=\"https://github.com/tanersener/smart-exception/blob/main/docs/assets/smart-exception-logo-v5.png\" width=\"240\" alt=\"Smart Exception Logo\"\u003e\n\n### 1. Features\n\n- Build shorter stack traces\n    - Start exception chain from a root package\n    - Group stack trace elements from the same package\n    - Ignore stack trace elements\n    - Ignore causes\n    - Define how many stack trace elements will be printed\n- Use `SmartExceptionConverter` in `logback` to generate shorter stack traces without a code change\n  - Create conversion rules to use within pattern layout \n  - Define a `throwableConverter` to format stack traces in `logstash-logback-encoder`  \n- Do not include module name while printing a stack trace element\n- Do not print suppressed exceptions\n- Customise how a stack trace element will be printed\n- Define how native methods and closed source stack trace elements will be printed\n- Search for a cause in an exception chain\n- Get the cause of a throwable\n- Print package information (jar file and version)\n\n### 2. Using\n\nBinaries are available at [Github](https://github.com/tanersener/smart-exception/releases)\nand [Maven Central](https://repo1.maven.org/maven2).\n\n#### 2.1. Java API\n\nUse `Java API` to access all features of the library. See \n[Java API](https://github.com/tanersener/smart-exception/wiki/Java-API) wiki page for the complete list of API methods.\n\nInstall `smart-exception` by adding one of the following dependencies to your `build.gradle`.\n\n- Java 9 or later\n\n```\ndependencies {\n    implementation 'com.arthenica:smart-exception-java9:0.2.1'\n}\n```\n\n- Java 7/8 or Android\n\n```\ndependencies {\n    implementation 'com.arthenica:smart-exception-java:0.2.1'\n}\n```\n\n##### 2.1.1 Import Exceptions class\n\nImport `Exceptions` class, which contains all utility methods, from the correct package.\n\n- Java 9 or later\n\n```\nimport com.arthenica.smartexception.java9.Exceptions;\n```\n\n- Java 7/8 or Android\n\n```\nimport com.arthenica.smartexception.java.Exceptions;\n```\n\n##### 2.1.2 Create shorter stack traces\n\nUse `getStackTraceString` method to create a shorter stack trace. By default, `getStackTraceString` will generate the\nsame long stack trace as a string for you. You need to define some rules for `getStackTraceString` to use. Those rules\ndefine how the exception stack trace is processed and shortened.\n\n```\nExceptions.getStackTraceString(e);\n```  \n\n##### 2.1.3 Use `root` packages.\n\n`root` package is the entry point in an exception chain. If you define a `root` package, then all stack trace elements\nbefore that `root` package will be discarded, and you will get a cleaner, compact stack trace. A `root` package can be\ndefined in two different ways.\n\n- By registering a global `root` package.\n\n```\nExceptions.registerRootPackage(\"com.arthenica\");\nExceptions.getStackTraceString(e);\n```\n\n- By providing a `root` package while getting the stack trace.\n\n```\nExceptions.getStackTraceString(e, \"com.arthenica\");\n```\n\n- You will have the following stack trace string.\n\n```\norg.springframework.web.util.NestedServletException: Method not found.\n    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)\n    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)\n    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)\n    at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:134)\n    at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:183)\n    at com.arthenica.smartexception.java.SpringTest.putUserTest(SpringTest.java:100)\n```\n\n- Instead of this one.\n\n```\norg.springframework.web.util.NestedServletException: Method not found.\n    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)\n    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)\n    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)\n    at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:134)\n    at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:183)\n    at com.arthenica.smartexception.java.SpringTest.putUserTest(SpringTest.java:100)\n    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n    at java.base/java.lang.reflect.Method.invoke(Method.java:564)\n    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)\n    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\n    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)\n    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\n    ... 35 more\n```\n\n#### 2.2. Logback converters\n\nInstall `smart-exception-logback` by adding the following dependency to your `build.gradle`.\n\nNote that `smart-exception-logback` requires Java 9 or later\n\n```\ndependencies {\n    implementation 'com.arthenica:smart-exception-logback:0.2.1'\n}\n```\n\n- Create a conversion rule to use `SmartExceptionConverter` in pattern layout\n\n```xml\n\u003cconversionRule conversionWord=\"smartEx\" converterClass=\"com.arthenica.smartexception.logback.SmartExceptionConverter\"/\u003e\n\n\u003cappender name=\"STDOUT\" class=\"ch.qos.logback.core.ConsoleAppender\"\u003e\n    \u003cencoder\u003e\n        \u003cpattern\u003e%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger - %msg %smartEx{'rootPackage=com.arthenica','printModuleName=false','ignorePackage=jdk.internal','printPackageInformation=true'}%n\u003c/pattern\u003e\n    \u003c/encoder\u003e\n\u003c/appender\u003e\n```\n\n- Define a `throwableConverter` to format stack traces in `logstash-logback-encoder`\n\n```xml\n    \u003cappender name=\"STDOUT\" class=\"ch.qos.logback.core.ConsoleAppender\"\u003e\n        \u003cencoder class=\"net.logstash.logback.encoder.LogstashEncoder\"\u003e\n            \u003cthrowableConverter class=\"com.arthenica.smartexception.logback.SmartExceptionConverter\"\u003e\n                \u003cprintModuleName\u003efalse\u003c/printModuleName\u003e\n                \u003cprintPackageInformation\u003etrue\u003c/printPackageInformation\u003e\n                \u003crootPackage\u003ecom.arthenica\u003c/rootPackage\u003e\n                \u003cgroupPackage\u003eorg.springframework\u003c/groupPackage\u003e\n                \u003cignorePackage\u003ejdk.internal\u003c/ignorePackage\u003e\n            \u003c/throwableConverter\u003e\n        \u003c/encoder\u003e\n    \u003c/appender\u003e\n```\n\n### 3. Versions\n\n|                           SmartException Version                           | Release Date |\n|:--------------------------------------------------------------------------:|:------------:|\n| [0.2.1](https://github.com/tanersener/smart-exception/releases/tag/v0.2.1) | May 30, 2022 |\n| [0.2.0](https://github.com/tanersener/smart-exception/releases/tag/v0.2.0) | Mar 13, 2022 |\n| [0.1.1](https://github.com/tanersener/smart-exception/releases/tag/v0.1.1) | Nov 28, 2021 |\n| [0.1.0](https://github.com/tanersener/smart-exception/releases/tag/v0.1.0) | Apr 12, 2020 |\n\n### 4. Building\n\n- Install Java 9 or later\n\n- Run\n\n```\n./gradlew clean build\n```\n\nSee the build status from the table below.\n\n|   branch    | status |\n|:-----------:| :---: |\n|    main     | ![build status](https://github.com/tanersener/smart-exception/actions/workflows/build.yml/badge.svg) |\n| development | ![build status](https://github.com/tanersener/smart-exception/actions/workflows/build.yml/badge.svg?branch=development) |\n\n### 5. Wiki\n\nA more detailed documentation is available at [Wiki](https://github.com/tanersener/smart-exception/wiki).\n\n### 6. Modules\n\n`SmartException` source code is organised into five modules.\n\n- `common` includes shared classes and interfaces\n- `java` has Java 7/8 and Android specific implementation\n- `java9` has the implementation for Java 9 or later\n- `logback` includes `logback` converter implementation\n- `test` includes test classes that use library jars published in `mavenCentral()`\n\n### 7. License\n\nThis project is licensed under the `BSD 3-Clause License`.\n\n### 8. Contributing\n\nFeel free to submit issues or pull requests. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanersener%2Fsmart-exception","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftanersener%2Fsmart-exception","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanersener%2Fsmart-exception/lists"}