Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
e8a438ca
Commit
e8a438ca
authored
Dec 01, 2016
by
apoorvnaik
Committed by
Suma Shivaprasad
Dec 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1347: Fix error codes for exceptions
parent
35670609
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
18 deletions
+20
-18
AtlasErrorCode.java
intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
+17
-16
release-log.txt
release-log.txt
+1
-0
TypesResource.java
...in/java/org/apache/atlas/web/resources/TypesResource.java
+2
-2
No files found.
intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
View file @
e8a438ca
...
...
@@ -20,14 +20,13 @@ package org.apache.atlas;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
javax.ws.rs.core.Response
;
import
java.text.MessageFormat
;
import
java.util.Arrays
;
import
javax.ws.rs.core.Response
;
public
enum
AtlasErrorCode
{
NO_SEARCH_RESULTS
(
204
,
"ATLAS2041E"
,
"Given search filter did not yield any results"
),
// All Bad request enums go here
UNKNOWN_TYPE
(
400
,
"ATLAS4001E"
,
"Unknown type {0} for {1}.{2}"
),
CIRCULAR_REFERENCE
(
400
,
"ATLAS4002E"
,
"{0}: invalid supertypes - circular reference back to self {1}"
),
INCOMPATIBLE_SUPERTYPE
(
400
,
"ATLAS4003E"
,
"{0}: incompatible supertype {1}"
),
...
...
@@ -43,31 +42,33 @@ public enum AtlasErrorCode {
ATTRIBUTE_DELETION_NOT_SUPPORTED
(
400
,
"ATLAS40013E"
,
"{0}.{1} : attribute delete not supported"
),
SUPERTYPE_REMOVAL_NOT_SUPPORTED
(
400
,
"ATLAS40014E"
,
"superType remove not supported"
),
UNEXPECTED_TYPE
(
400
,
"ATLAS40015E"
,
"expected type {0}; found {1}"
),
TYPE_MATCH_FAILED
(
400
,
"ATLAS40016E"
,
"Given type {0} doesn't match {1}"
),
INVALID_TYPE_DEFINITION
(
400
,
"ATLAS40017E"
,
"Invalid type definition {0}"
),
INVALID_ATTRIBUTE_TYPE_FOR_CARDINALITY
(
400
,
"ATLAS40018E"
,
"Cardinality of attribute {0}.{1} requires a list or set type"
),
ATTRIBUTE_UNIQUE_INVALID
(
400
,
"ATLAS40019E"
,
"Type {0} with unique attribute {1} does not exist"
),
TYPE_NAME_INVALID
(
400
,
"ATLAS40020E"
,
"Type {0} with name {1} does not exist"
),
TYPE_CATEGORY_INVALID
(
400
,
"ATLAS40021E"
,
"Type Category {0} does not match {1} or is invalid"
),
PATCH_NOT_APPLICABLE_FOR_TYPE
(
400
,
"ATLAS40022E"
,
"{0} - invalid patch for type {1}"
),
PATCH_FOR_UNKNOWN_TYPE
(
400
,
"ATLAS40023E"
,
"{0} - patch references unknown type {1}"
),
PATCH_INVALID_DATA
(
400
,
"ATLAS40024E"
,
"{0} - patch data is invalid for type {1}"
),
// All Not found enums go here
TYPE_NAME_NOT_FOUND
(
404
,
"ATLAS4041E"
,
"Given typename {0} was invalid"
),
TYPE_GUID_NOT_FOUND
(
404
,
"ATLAS4042E"
,
"Given type guid {0} was invalid"
),
EMPTY_RESULTS
(
404
,
"ATLAS4044E"
,
"No result found for {0}"
),
INSTANCE_GUID_NOT_FOUND
(
404
,
"ATLAS4045E"
,
"Given instance guid {0} is invalid"
),
INSTANCE_LINEAGE_INVALID_PARAMS
(
404
,
"ATLAS4046E"
,
"Invalid lineage query parameters passed {0}: {1}"
),
INSTANCE_LINEAGE_QUERY_FAILED
(
404
,
"ATLAS4047E"
,
"Instance lineage query failed {0}"
),
INSTANCE_ALREADY_EXISTS
(
405
,
"ATLAS4051E"
,
"Given entity with guid/name {0} already exists"
),
// All data conflict errors go here
TYPE_ALREADY_EXISTS
(
409
,
"ATLAS4091E"
,
"Given type {0} already exists"
),
TYPE_HAS_REFERENCES
(
409
,
"ATLAS4092E"
,
"Given type {0} has references"
),
TYPE_MATCH_FAILED
(
409
,
"ATLAS4093E"
,
"Given type {0} doesn't match {1}"
),
INVALID_TYPE_DEFINITION
(
409
,
"ATLAS4094E"
,
"Invalid type definition {0}"
),
INVALID_ATTRIBUTE_TYPE_FOR_CARDINALITY
(
409
,
"ATLAS4095E"
,
"Cardinality of attribute {0}.{1} requires a list or set type"
),
INSTANCE_ALREADY_EXISTS
(
409
,
"ATLAS4093E"
,
"Given entity {0} already exists"
),
// All internal errors go here
INTERNAL_ERROR
(
500
,
"ATLAS5001E"
,
"Internal server error {0}"
),
INDEX_CREATION_FAILED
(
500
,
"ATLAS5002E"
,
"Index creation failed for {0}"
),
INDEX_ROLLBACK_FAILED
(
500
,
"ATLAS5003E"
,
"Index rollback failed for {0}"
),
PATCH_NOT_APPLICABLE_FOR_TYPE
(
500
,
"ATLAS5004E"
,
"{0} - invalid patch for type {1}"
),
PATCH_FOR_UNKNOWN_TYPE
(
500
,
"ATLAS5005E"
,
"{0} - patch references unknown type {1}"
),
PATCH_INVALID_DATA
(
500
,
"ATLAS5006E"
,
"{0} - patch data is invalid for type {1}"
),
ATTRIBUTE_UNIQUE_INVALID
(
400
,
"ATLAS40015E"
,
"Type {0} with unique attribute {1} does not exist"
),
TYPE_NAME_INVALID
(
400
,
"ATLAS40016E"
,
"Type {0} with name {1} does not exist"
),
TYPE_CATEGORY_INVALID
(
400
,
"ATLAS40017E"
,
"Type Category {0} does not match {1} or is invalid"
);
INDEX_ROLLBACK_FAILED
(
500
,
"ATLAS5003E"
,
"Index rollback failed for {0}"
);
private
String
errorCode
;
private
String
errorMessage
;
...
...
release-log.txt
View file @
e8a438ca
...
...
@@ -9,6 +9,7 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al
ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES:
ATLAS-1347 Creating a class with unknown supertype results in "409 Conflict", where as expected is "400 Bad Message" (apoorvnairk via sumasai)
ATLAS-737 Add DSL support for Sum, Max, Min and count operations with and without group by (guptaneeru via dkantor)
ATLAS-1305 Fix potential NPEs in instance conversion code (sumasai)
ATLAS-1349 Reduce excessive exception logging (apoorvnaik via svimal2106)
...
...
webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java
View file @
e8a438ca
...
...
@@ -116,8 +116,8 @@ public class TypesResource {
response
.
put
(
AtlasClient
.
TYPES
,
typesResponse
);
return
Response
.
status
(
ClientResponse
.
Status
.
CREATED
).
entity
(
response
).
build
();
}
catch
(
AtlasBaseException
e
)
{
LOG
.
error
(
"Type
already exists
"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
CONFLICT
));
LOG
.
error
(
"Type
creation failed
"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
e
.
getAtlasErrorCode
().
getHttpCode
()
));
}
catch
(
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to persist types"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment