From commits-return-7511-archive-asf-public=cust-asf.ponee.io@pulsar.incubator.apache.org Tue May 1 18:46:40 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id CA4FE180645 for ; Tue, 1 May 2018 18:46:39 +0200 (CEST) Received: (qmail 92699 invoked by uid 500); 1 May 2018 16:46:38 -0000 Mailing-List: contact commits-help@pulsar.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pulsar.incubator.apache.org Delivered-To: mailing list commits@pulsar.incubator.apache.org Received: (qmail 92690 invoked by uid 99); 1 May 2018 16:46:38 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 May 2018 16:46:38 +0000 From: GitBox To: commits@pulsar.apache.org Subject: [GitHub] merlimat commented on a change in pull request #1692: Return an error if schema is incompatible Message-ID: <152519319839.28305.14630639003430681675.gitbox@gitbox.apache.org> Date: Tue, 01 May 2018 16:46:38 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit merlimat commented on a change in pull request #1692: Return an error if schema is incompatible URL: https://github.com/apache/incubator-pulsar/pull/1692#discussion_r185269433 ########## File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/SchemasResource.java ########## @@ -212,7 +215,18 @@ public void postSchema( .build() ).build() ) - ); + ).exceptionally(error -> { + if (error instanceof IncompatibleSchemaException) { + response.resume( + Response.status(Response.Status.BAD_REQUEST).build() Review comment: Can we use something more specific than HTTP 400 error? That would help on the client side to figure out the reason of the error. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services