@Override
    public String getMessage()
    {
        String message = super.getMessage();
        if (message == null && getCause() != null) {
            message = getCause().getMessage();
        }
        if (message == null) {
            message = errorCode.getName();
        }
        return message;
    }
@Test
    public void testMessage()
    {
        PrestoException exception = new PrestoException(new TestErrorCode(), "test");
        assertEquals(exception.getMessage(), "test");

        exception = new PrestoException(new TestErrorCode(), new RuntimeException("test2"));
        assertEquals(exception.getMessage(), "test2");

        exception = new PrestoException(new TestErrorCode(), new RuntimeException());
        assertEquals(exception.getMessage(), "test");
    }