{"id":20207824,"url":"https://github.com/exasol/error-reporting-java","last_synced_at":"2026-06-07T03:31:26.675Z","repository":{"id":45936245,"uuid":"305346839","full_name":"exasol/error-reporting-java","owner":"exasol","description":"Java builder for error messages","archived":false,"fork":false,"pushed_at":"2023-08-04T11:45:47.000Z","size":95,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-01-13T21:09:28.179Z","etag":null,"topics":["error-handling","error-reporting","exasol-integration","foundation-library","java","unification"],"latest_commit_sha":null,"homepage":"","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/exasol.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-19T10:29:38.000Z","updated_at":"2022-09-22T06:30:15.000Z","dependencies_parsed_at":"2024-11-14T05:32:47.132Z","dependency_job_id":"a08da8d2-a5c7-4bd7-b04f-8db1df5ea370","html_url":"https://github.com/exasol/error-reporting-java","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exasol%2Ferror-reporting-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exasol%2Ferror-reporting-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exasol%2Ferror-reporting-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exasol%2Ferror-reporting-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exasol","download_url":"https://codeload.github.com/exasol/error-reporting-java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241644559,"owners_count":19996179,"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":["error-handling","error-reporting","exasol-integration","foundation-library","java","unification"],"created_at":"2024-11-14T05:32:32.229Z","updated_at":"2026-06-07T03:31:24.486Z","avatar_url":"https://github.com/exasol.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Error Reporting\n\n[![Build Status](https://github.com/exasol/error-reporting-java/actions/workflows/ci-build.yml/badge.svg)](https://github.com/exasol/error-reporting-java/actions/workflows/ci-build.yml)\n[![Maven Central \u0026ndash; error-reporting-java](https://img.shields.io/maven-central/v/com.exasol/error-reporting-java)](https://search.maven.org/artifact/com.exasol/error-reporting-java)\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aerror-reporting-java\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=com.exasol%3Aerror-reporting-java)\n\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aerror-reporting-java\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=com.exasol%3Aerror-reporting-java)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aerror-reporting-java\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=com.exasol%3Aerror-reporting-java)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aerror-reporting-java\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=com.exasol%3Aerror-reporting-java)\n[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aerror-reporting-java\u0026metric=sqale_index)](https://sonarcloud.io/dashboard?id=com.exasol%3Aerror-reporting-java)\n\n[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aerror-reporting-java\u0026metric=code_smells)](https://sonarcloud.io/dashboard?id=com.exasol%3Aerror-reporting-java)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aerror-reporting-java\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=com.exasol%3Aerror-reporting-java)\n[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aerror-reporting-java\u0026metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=com.exasol%3Aerror-reporting-java)\n[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aerror-reporting-java\u0026metric=ncloc)](https://sonarcloud.io/dashboard?id=com.exasol%3Aerror-reporting-java)\n\nThis project contains a Java-Builder for Exasol error messages.\nThe invocations of the Builder can be parsed by the [error-code-crawler-maven-plugin](https://github.com/exasol/error-code-crawler-maven-plugin).\n\n## Usage\n\n### Simple Messages\n\n```java\nExaError.messageBuilder(\"E-TEST-1\").message(\"Something went wrong.\").toString();\n```\n\nResult: `E-TEST-1: Something went wrong.`\n\n### Parameters\n\nYou can specify placeholders in the message and replace them with parameters values, as follows:\n\n```java\nExaError.messageBuilder(\"E-TEST-2\")\n    .message(\"Unknown input: {{input}}.\")\n    .parameter(\"input\", \"unknown\", \"The illegal user input.\").toString();\n```\n\nResult:\n\n    E-TEST-2: Unknown input: 'unknown'.`\n\nThe optional third parameter for `parameter(placeholder, value, description)` is used by the [error-code-crawler-maven-plugin](https://github.com/exasol/error-code-crawler-maven-plugin) to generate a parameter description.\n\nFrom version `0.3.0` on you can achieve the same result by specifying the parameter values directly in the `message()` method. This is a convenience variant that is a little more compact, but lacks the chance to describe the parameter.\n\n```java\nExaError.messageBuilder(\"E-TEST-2\")\n    .message(\"Message with {{first-parameter}} and {{second-parameter}}.\", \"first value\", \"second value\").toString();\n```\n\nResult:\n\n    E-TEST-2: Message with 'q-value' and uq-value.\n\n#### Automatic Quoting\n\nWhen replacing placeholders in messages, `ExaError` quotes the values according to your choices. If you don't specify a quoting option in a placeholder, you get auto-quoting. In this mode values are quoted depending on their type.\n\n| Type                 | Quoted with     | Example                    | Since version |\n|----------------------|-----------------|----------------------------|--------------:|\n| `String`             | single quotes   | `'Hello world!'`           |               |\n| `Character` / `char` | single quotes   | `'A'`                      |               |\n| `Path`               | single quotes   | `'/etc/cron.d'`            |         1.0.0 |\n| `File`               | single quotes   | `'~/.bashrc'`              |         1.0.0 |\n| `URI`                | single quotes   | `'URN:ISBN:0-330-28700-1'` |         1.0.0 |\n| `URL`                | single quotes   | `'https://example.org'`    |         1.0.0 |\n| null values          | pointy brackets | `\u003cnull\u003e`                   |               |\n| everything else      | not quoted      | `42`, `3.1415`, `true`     |               |\n\n#### Manual Quoting\n\nIf you need a different quoting style, you can add switches to the placeholder definition:\n\n`u`\n: unquoted\n\n`q`\n: forced single quotes\n\n`d`\n: forced double quotes\n\nIf multiple conflicting switches are given, the one with the highest precedence (see list above) is taken.\n\nSwitches are separated with a pipe symbol `|` from the parameter name.\n\n```java\nExaError.messageBuilder(\"E-TEST-2\")\n    .message(\"Unknown input: {{input|u}}.\")\n    .parameter(\"input\", \"unknown\", \"The illegal user input.\").toString();\n```\n\nResult:\n\n    E-TEST-2: Unknown input: unknown.\n\n### Mitigations\n\nThe mitigations describe actions the user can take to resolve the error. Here is an example of a mitigation definition:\n\n```java\nExaError.messageBuilder(\"E-TEST-2\")\n    .message(\"Not enough space on device.\")\n    .mitigation(\"Delete something.\")\n    .toString();\n```\n\nResult:\n\n    E-TEST-2: Not enough space on device. Delete something.\n\nYou can use parameters in mitigations too.\n\n```java\nExaError.messageBuilder(\"E-TEST-2\")\n    .message(\"Not enough space on device {{device}}.\")\n    .mitigation(\"Delete something from {{device}}.\")\n    .parameter(\"device\", \"/dev/sda1\", \"name of the device\")\n    .toString();\n```\n\nResult: \n\n    E-TEST-2: Not enough space on device '/dev/sda1'. Delete something from '/dev/sda1'.`\n\nYou can chain `mitigation` definitions if you want to tell the users that there is more than one solution.\n\n```java\nExaError.messageBuilder(\"E-TEST-2\")\n    .message(\"Not enough space on device.\")\n    .mitigation(\"Delete something.\")\n    .mitigation(\"Create larger partition.\")\n    .toString();\n```\n\nResult:\n\n    E-TEST-2: Not enough space on device. Known mitigations:\n    * Delete something.\n    * Create larger partition.\n\n### Never Change the Meaning of an Error\n\nIf you have an error that does not fit anymore or was wrong to begin with, don't reuse the error code. Instead,\nremove the old one and create a new one with a new code.\n\nWhat you can do is fix typos in error, improve the readability or make them more detailed. But you should never change\nthe meaning of an existing error.\n\n### Removing Obsolete Error Codes\n\nIn order to ensure a linear history of the error codes, developers should not reuse old error codes.\n\nSo when you plan to remove an obsolete error code:\n\n1. Remove it from the implementation\n2. Leave the `highest-index` in the `error_code_config.yml` untouched.\n\n   Even if you deleted the entry with the highest number. The whole purpose of that index is to help avoid reusing error codes.\n\n3. Do not reuse the error code (see [\"Never Change the Meaning of an Error\"](#never-change-the-meaning-of-an-error)).\n\n## Information for Users\n\n- [Changelog](doc/changes/changelog.md)\n\n## Information for Developers\n\n- [Dependencies](dependencies.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexasol%2Ferror-reporting-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexasol%2Ferror-reporting-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexasol%2Ferror-reporting-java/lists"}