Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/exasol/error-reporting-lua
Lua builder for error message
https://github.com/exasol/error-reporting-lua
builder error-reporting exasol-integration foundation-library
Last synced: about 2 months ago
JSON representation
Lua builder for error message
- Host: GitHub
- URL: https://github.com/exasol/error-reporting-lua
- Owner: exasol
- License: mit
- Created: 2021-07-02T06:17:50.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-07T12:07:58.000Z (almost 2 years ago)
- Last Synced: 2024-04-16T18:50:27.306Z (9 months ago)
- Topics: builder, error-reporting, exasol-integration, foundation-library
- Language: Lua
- Homepage:
- Size: 54.7 KB
- Stars: 2
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Error Reporting Lua
This project contains the source code for the `ExaError` Lua module. This module lets you define errors with a uniform set of attributes. The created error objects can be used in places where strings are expected like in string concatenation.
And you can conveniently raise a Lua `error` from them.
Additionally, the resulting code is made to be parseable, so that you can extract an error catalog from the code.
## In a Nutshell
Define an error object:
```lua
local ExaError = require("ExaError")local errobj = ExaError:new("E-IO-13", "Need {{needed}} MiB space, but only {{remaining}} MiB left on device {{device}}.",
{needed = 500.2, remaining = 14.8, device = "/dev/sda4"})
```Use it as string:
```lua
print(errobj)
```Raise a corresponding Lua error
```lua
errobj:raise()
```Or shorter:
```lua
ExaError.error("E-IO-13", "Need {{needed}} MiB space, but only {{remaining}} MiB left on device {{device}}.",
{needed = 500.2, remaining = 14.8, device = "/dev/sda4"})
```Check out the [user guide](doc/user_guide/user_guide.md) for more details.
## Features
1. Define error objects with error code, message, placeholders, parameters and mitigations
1. Use error objects where strings are expected
1. Raise errors from error objects## Information for Users
* [User Guide](doc/user_guide/user_guide.md)
* [Change Log](doc/changes/changelog.md)
* [MIT License](LICENSE)You can find corresponding libraries for other languages here:
* [Error reporting Java](https://github.com/exasol/error-reporting-java)
* [Error reporting C#](https://github.com/exasol/error-reporting-csharp)### Dependencies
The only runtime-dependency of this module is Lua 5.1 or later.
See the [dependencies list](dependencies.md) for build and test dependencies and license information.