public Type parse(final String schema) {
    try {
      final TypeContext typeContext = parseTypeContext(schema);
      return getType(typeContext);
    } catch (final ParsingException e) {
      throw new KsqlStatementException(
          "Failed to parse schema",
          "Failed to parse: " + schema,
          schema,
          KsqlStatementException.Problem.STATEMENT,
          e
      );
    }
  }
@Test
  public void shouldThrowMeaningfulErrorOnBadStructDeclaration() {
    // Given:
    final String schemaString = "STRUCT<foo VARCHAR,>";

    // When:
    final KsqlStatementException e = assertThrows(
        KsqlStatementException.class,
        () -> parser.parse(schemaString)
    );

    // Then:
    System.out.println(e.getMessage());
    assertThat(e.getUnloggedMessage(), is(
        "Failed to parse: STRUCT<foo VARCHAR,>\nStatement: STRUCT<foo VARCHAR,>"
    ));
    assertThat(e.getMessage(), is(
        "Failed to parse schema"
    ));
    assertThat(e.getCause().getMessage(), is(
        "line 1:20: Syntax error at line 1:20"
    ));
  }