{"id":37019049,"url":"https://github.com/sepulrator/java-exception-api","last_synced_at":"2026-01-14T02:02:44.436Z","repository":{"id":57722669,"uuid":"74839332","full_name":"sepulrator/java-exception-api","owner":"sepulrator","description":null,"archived":false,"fork":false,"pushed_at":"2016-12-28T20:42:05.000Z","size":38,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-06T17:55:56.275Z","etag":null,"topics":["aspect-oriented-programming","callback","exception-handler","exception-messages","java","java-library","singleton-pattern"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/sepulrator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-26T17:09:44.000Z","updated_at":"2018-04-06T11:18:35.000Z","dependencies_parsed_at":"2022-08-28T08:22:46.849Z","dependency_job_id":null,"html_url":"https://github.com/sepulrator/java-exception-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sepulrator/java-exception-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sepulrator%2Fjava-exception-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sepulrator%2Fjava-exception-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sepulrator%2Fjava-exception-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sepulrator%2Fjava-exception-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sepulrator","download_url":"https://codeload.github.com/sepulrator/java-exception-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sepulrator%2Fjava-exception-api/sbom","scorecard":{"id":811736,"data":{"date":"2025-08-11","repo":{"name":"github.com/sepulrator/java-exception-api","commit":"4bb90614a3aa591e1c0dde1b3cef895d1f621786"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Code-Review","score":0,"reason":"Found 0/29 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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"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":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-5mg8-w23w-74h3","Warn: Project is vulnerable to: GHSA-7g45-4rm6-3mm3","Warn: Project is vulnerable to: GHSA-mvr2-9pj6-7w5j","Warn: Project is vulnerable to: GHSA-2qrg-x229-3v8q","Warn: Project is vulnerable to: GHSA-65fg-84f6-3jq3","Warn: Project is vulnerable to: GHSA-f7vh-qwp3-x37m","Warn: Project is vulnerable to: GHSA-fp5r-v3w9-4333","Warn: Project is vulnerable to: GHSA-w9p3-5cr8-m3jj"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T13:21:34.743Z","repository_id":57722669,"created_at":"2025-08-23T13:21:34.743Z","updated_at":"2025-08-23T13:21:34.743Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":["aspect-oriented-programming","callback","exception-handler","exception-messages","java","java-library","singleton-pattern"],"created_at":"2026-01-14T02:02:43.778Z","updated_at":"2026-01-14T02:02:44.427Z","avatar_url":"https://github.com/sepulrator.png","language":"Java","readme":"Java exception api is a exception utility library for handling and managing exception without much efforts. \n\nMaven repository\n```sh\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecom.github.sepulrator\u003c/groupId\u003e\n      \u003cartifactId\u003eexception-util\u003c/artifactId\u003e\n      \u003cversion\u003e1.0.0\u003c/version\u003e\n    \u003c/dependency\u003e\n```\n\n## Exception handling\nYou can handle any exception by annotating your class with ExceptionAdvice. You can specify which methods will be executed by annotating method with @ExceptionHandler and specifying child exception class name. \n\nIn the below example, logException() method is executed after any method throws a null pointer exception or array index out of bounds exception. \nIf a method annotated with ExceptionScan, the method is executed after any method in specified scanning directives throws an exception.\n\n```java\n@ExceptionAdvice\npublic class MyExceptionAdvice {\n\n  @ExceptionHandler({NullPointerException.class,ArrayIndexOutOfBoundsException.class})\n  public void logException(ExceptionInfo exceptionInfo) {\n     // do some stuff\n    System.out.println(exceptionInfo.toString());\n  }\n  \n  @ExceptionHandler({IllegalArgumentException.class})\n  @ExceptionScan({\"com.test\"})\n  public void afterIllegalArgumentException(ExceptionInfo exceptionInfo) {\n    // do some stuff\n    System.out.println(exceptionInfo.toString());\n  }\n\n}\n```\n## Log4j support\nLog level can be set by setting \"org.javaex\" package for logging. \n```\nlog4j.logger.org.javaex=DEBUG\n```\n\n## File Based Exception Message Management\nTo benefit from this feature, your exception class must extend the custom exception class like the below example. \nSince multi code is supported, How many codes that will be used in exceptions can be determined by the client. \n```java\npublic class MyNullPointerException extends CustomException {\n  \n  public MyNullPointerException(String errorCode) {\n    super(errorCode);\n  }\n  \n  public MyNullPointerException(String errorCode, String reasonCode) {\n    super(errorCode,reasonCode);\n  }\n\n}\n```\nTo get the defined error message, \"exception.definition\" file must be created under resources folder. \n\nexception.definition:\n```\n0001=My Null Pointer Exception Defined Message\n0001,2=My Null Pointer Exception Defined Message With ReasonCode\n```\n\nSample code for get the thrown exception message from resource file.\n```java\n    try {\n      throwCustomException();\n    } catch (MyNullPointerException e) {\n      System.err.println(e.getDefinedErrorMessage());\n      // prints out \"My Null Pointer Exception Defined Message\"\n    }\n    \n    try {\n      throwCustomExceptionWithReason();\n    } catch (MyNullPointerException e) {\n      System.err.println(e.getDefinedErrorMessage());\n      // prints out\"My Null Pointer Exception Defined Message With ReasonCode\"\n    }\n\n  public void throwCustomException() throws MyNullPointerException {\n    if (1==1)\n      throw new MyNullPointerException(\"0001\");\n  }\n  \n  public void throwCustomExceptionWithReason() throws MyNullPointerException {\n    if (1==1)\n    throw new MyNullPointerException(\"0001\",\"2\");\n  }\n  \n```  \n  \n  \n  \n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsepulrator%2Fjava-exception-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsepulrator%2Fjava-exception-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsepulrator%2Fjava-exception-api/lists"}