Skip to the content.

D10094 - Exception, Defined your Errors

Zero system provide simple error define for user.

1. Configuration

In your class path, create a new up.god.file named vertx-error.yml,the format is as following:

E100001: User defined Error {0}, details = {1}

The detail implementation used MessageFormat, do not support named parameters.

2. Create Class

Create new class that you wanted as following

import io.vertx.up.exception.WebException;

public class TestRequestException extends
        WebException {
    public TestRequestException(final Class<?> clazz,
                                final String name,
                                final String detail) {
        super(clazz, name, detail);

    public int getCode() {
        return -100001;

3. Build Envelop with Error

Then in your code, write following code:

    public Envelop reply(final Envelop message) {
        final User user =;
        final WebException error = new TestRequestException(getClass(),
                "Lang", "Detail");
        return Envelop.failure(error);

4. Running the App

You’ll see following error response:

    "code": -100001,
    "message": "[ERR-100001] (UserWorker) ZeroException occurs: User defined Error Lang, details = Detail."