Skip to content

Commit

Permalink
chore: update response code on pull queries disabled to be 4xx (MINOR) (
Browse files Browse the repository at this point in the history
  • Loading branch information
vcrfxia authored Aug 26, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent bb111ee commit 94dac3d
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -180,12 +180,13 @@ public PullQueryResult execute(
}

if (!statement.getConfig().getBoolean(KsqlConfig.KSQL_PULL_QUERIES_ENABLE_CONFIG)) {
throw new KsqlException(
throw new KsqlStatementException(
"Pull queries are disabled."
+ PullQueryValidator.PULL_QUERY_SYNTAX_HELP
+ System.lineSeparator()
+ "Please set " + KsqlConfig.KSQL_PULL_QUERIES_ENABLE_CONFIG + "=true to enable "
+ "this feature.");
+ "this feature.",
statement.getStatementText());
}

try {
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@
import io.confluent.ksql.statement.ConfiguredStatement;
import io.confluent.ksql.util.KsqlConfig;
import io.confluent.ksql.util.KsqlException;
import io.confluent.ksql.util.KsqlStatementException;
import java.util.Optional;
import org.apache.kafka.common.utils.Time;
import org.junit.Rule;
@@ -79,7 +80,7 @@ public void shouldThrowExceptionIfConfigDisabled() {

// When:
final Exception e = assertThrows(
KsqlException.class,
KsqlStatementException.class,
() -> pullQueryExecutor.execute(query, engine.getServiceContext(), Optional.empty(), 0L)
);

0 comments on commit 94dac3d

Please sign in to comment.