Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 02F6D200C72 for ; Fri, 28 Apr 2017 02:01:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 01708160BB2; Fri, 28 Apr 2017 00:01:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 487D4160BA7 for ; Fri, 28 Apr 2017 02:01:09 +0200 (CEST) Received: (qmail 44651 invoked by uid 500); 28 Apr 2017 00:01:07 -0000 Mailing-List: contact commits-help@atlas.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@atlas.incubator.apache.org Delivered-To: mailing list commits@atlas.incubator.apache.org Received: (qmail 44573 invoked by uid 99); 28 Apr 2017 00:01:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Apr 2017 00:01:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 4F4A51B0EF0 for ; Fri, 28 Apr 2017 00:01:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.221 X-Spam-Level: X-Spam-Status: No, score=-4.221 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id bevzm7bsHTon for ; Fri, 28 Apr 2017 00:01:06 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 28B0F5F3BF for ; Fri, 28 Apr 2017 00:01:06 +0000 (UTC) Received: (qmail 41954 invoked by uid 99); 28 Apr 2017 00:01:05 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Apr 2017 00:01:05 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 81C31DFBBB; Fri, 28 Apr 2017 00:01:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sarath@apache.org To: commits@atlas.incubator.apache.org Message-Id: <9f3f60caad6941ed833a67b22caea5ff@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-atlas git commit: ATLAS-1611: Regression: Incorrect error code for the negative tests, returned: 500 server error, expected: 400 bad request Date: Fri, 28 Apr 2017 00:01:05 +0000 (UTC) archived-at: Fri, 28 Apr 2017 00:01:10 -0000 Repository: incubator-atlas Updated Branches: refs/heads/master 4feee3bf6 -> 3a70d11d3 ATLAS-1611: Regression: Incorrect error code for the negative tests, returned: 500 server error, expected: 400 bad request Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/3a70d11d Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/3a70d11d Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/3a70d11d Branch: refs/heads/master Commit: 3a70d11d3c1a5d51e2c783ec28d9693b61bea71b Parents: 4feee3b Author: Sarath Subramanian Authored: Thu Apr 27 17:00:58 2017 -0700 Committer: Sarath Subramanian Committed: Thu Apr 27 17:00:58 2017 -0700 ---------------------------------------------------------------------- .../org/apache/atlas/web/resources/EntityResource.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/3a70d11d/webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java ---------------------------------------------------------------------- diff --git a/webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java b/webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java index 8328da5..19c5594 100755 --- a/webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java +++ b/webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java @@ -1190,8 +1190,14 @@ public class EntityResource { return jsonArray; } - private AtlasEntityType getEntityType(String typeName) { - return typeRegistry.getEntityTypeByName(typeName); + private AtlasEntityType getEntityType(String typeName) throws AtlasBaseException { + AtlasEntityType ret = typeRegistry.getEntityTypeByName(typeName); + + if (ret == null) { + throw new AtlasBaseException(AtlasErrorCode.TYPE_NAME_NOT_FOUND, typeName); + } + + return ret; } public static WebApplicationException toWebApplicationException(AtlasBaseException e) {