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
84c8636d
Commit
84c8636d
authored
May 29, 2015
by
Shwetha G S
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #113 from sumashivaprasad/BUG_37105
BUG-36503 - Standardizing response on internal errors, client side errors
parents
d0ce7d60
d2fba3b4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
52 deletions
+62
-52
EntityResource.java
.../apache/hadoop/metadata/web/resources/EntityResource.java
+8
-8
HiveLineageResource.java
...he/hadoop/metadata/web/resources/HiveLineageResource.java
+19
-17
MetadataDiscoveryResource.java
...oop/metadata/web/resources/MetadataDiscoveryResource.java
+21
-21
TypesResource.java
...g/apache/hadoop/metadata/web/resources/TypesResource.java
+14
-6
No files found.
webapp/src/main/java/org/apache/hadoop/metadata/web/resources/EntityResource.java
View file @
84c8636d
...
...
@@ -90,11 +90,11 @@ public class EntityResource {
response
.
put
(
MetadataServiceClient
.
DEFINITION
,
entity
);
return
Response
.
created
(
locationURI
).
entity
(
response
).
build
();
}
catch
(
MetadataException
|
I
OException
|
I
llegalArgumentException
e
)
{
}
catch
(
MetadataException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to persist entity instance"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to persist entity instance"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
@@ -132,7 +132,7 @@ public class EntityResource {
LOG
.
error
(
"An entity with GUID={} does not exist"
,
guid
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
NOT_FOUND
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get instance definition for GUID {}"
,
guid
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
@@ -168,7 +168,7 @@ public class EntityResource {
LOG
.
error
(
"Unable to get entity list for type {}"
,
entityType
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get entity list for type {}"
,
entityType
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
@@ -198,7 +198,7 @@ public class EntityResource {
LOG
.
error
(
"Unable to add property {} to entity id {}"
,
property
,
guid
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to add property {} to entity id {}"
,
property
,
guid
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
@@ -231,7 +231,7 @@ public class EntityResource {
LOG
.
error
(
"Unable to get trait names for entity {}"
,
guid
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get trait names for entity {}"
,
guid
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
@@ -267,7 +267,7 @@ public class EntityResource {
LOG
.
error
(
"Unable to add trait for entity={}"
,
guid
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to add trait for entity={}"
,
guid
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
@@ -301,7 +301,7 @@ public class EntityResource {
LOG
.
error
(
"Unable to delete trait name={} for entity={}"
,
traitName
,
guid
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to delete trait name={} for entity={}"
,
traitName
,
guid
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
webapp/src/main/java/org/apache/hadoop/metadata/web/resources/HiveLineageResource.java
View file @
84c8636d
...
...
@@ -18,12 +18,11 @@
package
org
.
apache
.
hadoop
.
metadata
.
web
.
resources
;
import
com.google.common.base.Preconditions
;
import
org.apache.hadoop.metadata.MetadataServiceClient
;
import
org.apache.hadoop.metadata.ParamChecker
;
import
org.apache.hadoop.metadata.discovery.DiscoveryException
;
import
org.apache.hadoop.metadata.discovery.LineageService
;
import
org.apache.hadoop.metadata.web.util.Servlets
;
import
org.codehaus.jettison.json.JSONException
;
import
org.codehaus.jettison.json.JSONObject
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -69,10 +68,11 @@ public class HiveLineageResource {
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
Response
inputs
(
@Context
HttpServletRequest
request
,
@PathParam
(
"tableName"
)
String
tableName
)
{
Preconditions
.
checkNotNull
(
tableName
,
"table name cannot be null"
);
LOG
.
info
(
"Fetching lineage inputs for tableName={}"
,
tableName
);
try
{
ParamChecker
.
notEmpty
(
tableName
,
"table name cannot be null"
);
final
String
jsonResult
=
lineageService
.
getInputs
(
tableName
);
JSONObject
response
=
new
JSONObject
();
...
...
@@ -81,11 +81,11 @@ public class HiveLineageResource {
response
.
put
(
MetadataServiceClient
.
RESULTS
,
new
JSONObject
(
jsonResult
));
return
Response
.
ok
(
response
).
build
();
}
catch
(
DiscoveryException
e
)
{
}
catch
(
DiscoveryException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to get lineage inputs for table {}"
,
tableName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get lineage inputs for table {}"
,
tableName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
@@ -103,10 +103,10 @@ public class HiveLineageResource {
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
Response
inputsGraph
(
@Context
HttpServletRequest
request
,
@PathParam
(
"tableName"
)
String
tableName
)
{
Preconditions
.
checkNotNull
(
tableName
,
"table name cannot be null"
);
LOG
.
info
(
"Fetching lineage inputs graph for tableName={}"
,
tableName
);
try
{
ParamChecker
.
notEmpty
(
tableName
,
"table name cannot be null"
);
final
String
jsonResult
=
lineageService
.
getInputsGraph
(
tableName
);
JSONObject
response
=
new
JSONObject
();
...
...
@@ -115,11 +115,11 @@ public class HiveLineageResource {
response
.
put
(
MetadataServiceClient
.
RESULTS
,
new
JSONObject
(
jsonResult
));
return
Response
.
ok
(
response
).
build
();
}
catch
(
DiscoveryException
e
)
{
}
catch
(
DiscoveryException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to get lineage inputs graph for table {}"
,
tableName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get lineage inputs graph for table {}"
,
tableName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
@@ -138,10 +138,10 @@ public class HiveLineageResource {
public
Response
outputs
(
@Context
HttpServletRequest
request
,
@PathParam
(
"tableName"
)
String
tableName
)
{
Preconditions
.
checkNotNull
(
tableName
,
"table name cannot be null"
);
LOG
.
info
(
"Fetching lineage outputs for tableName={}"
,
tableName
);
try
{
ParamChecker
.
notEmpty
(
tableName
,
"table name cannot be null"
);
final
String
jsonResult
=
lineageService
.
getOutputs
(
tableName
);
JSONObject
response
=
new
JSONObject
();
...
...
@@ -150,11 +150,11 @@ public class HiveLineageResource {
response
.
put
(
MetadataServiceClient
.
RESULTS
,
new
JSONObject
(
jsonResult
));
return
Response
.
ok
(
response
).
build
();
}
catch
(
DiscoveryException
e
)
{
}
catch
(
DiscoveryException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to get lineage outputs for table {}"
,
tableName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get lineage outputs for table {}"
,
tableName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
@@ -172,10 +172,11 @@ public class HiveLineageResource {
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
Response
outputsGraph
(
@Context
HttpServletRequest
request
,
@PathParam
(
"tableName"
)
String
tableName
)
{
Preconditions
.
checkNotNull
(
tableName
,
"table name cannot be null"
);
LOG
.
info
(
"Fetching lineage outputs graph for tableName={}"
,
tableName
);
try
{
ParamChecker
.
notEmpty
(
tableName
,
"table name cannot be null"
);
final
String
jsonResult
=
lineageService
.
getOutputsGraph
(
tableName
);
JSONObject
response
=
new
JSONObject
();
...
...
@@ -184,11 +185,11 @@ public class HiveLineageResource {
response
.
put
(
MetadataServiceClient
.
RESULTS
,
new
JSONObject
(
jsonResult
));
return
Response
.
ok
(
response
).
build
();
}
catch
(
DiscoveryException
e
)
{
}
catch
(
DiscoveryException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to get lineage outputs graph for table {}"
,
tableName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get lineage outputs graph for table {}"
,
tableName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
@@ -207,10 +208,11 @@ public class HiveLineageResource {
public
Response
schema
(
@Context
HttpServletRequest
request
,
@PathParam
(
"tableName"
)
String
tableName
)
{
Preconditions
.
checkNotNull
(
tableName
,
"table name cannot be null"
);
LOG
.
info
(
"Fetching schema for tableName={}"
,
tableName
);
try
{
ParamChecker
.
notEmpty
(
tableName
,
"table name cannot be null"
);
final
String
jsonResult
=
lineageService
.
getSchema
(
tableName
);
JSONObject
response
=
new
JSONObject
();
...
...
@@ -219,11 +221,11 @@ public class HiveLineageResource {
response
.
put
(
MetadataServiceClient
.
RESULTS
,
new
JSONObject
(
jsonResult
));
return
Response
.
ok
(
response
).
build
();
}
catch
(
DiscoveryException
e
)
{
}
catch
(
DiscoveryException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to get schema for table {}"
,
tableName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get schema for table {}"
,
tableName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
webapp/src/main/java/org/apache/hadoop/metadata/web/resources/MetadataDiscoveryResource.java
View file @
84c8636d
...
...
@@ -20,6 +20,7 @@ package org.apache.hadoop.metadata.web.resources;
import
com.google.common.base.Preconditions
;
import
org.apache.hadoop.metadata.MetadataServiceClient
;
import
org.apache.hadoop.metadata.ParamChecker
;
import
org.apache.hadoop.metadata.discovery.DiscoveryException
;
import
org.apache.hadoop.metadata.discovery.DiscoveryService
;
import
org.apache.hadoop.metadata.web.util.Servlets
;
...
...
@@ -76,20 +77,22 @@ public class MetadataDiscoveryResource {
@Path
(
"search"
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
Response
search
(
@QueryParam
(
"query"
)
String
query
)
{
Preconditions
.
checkNotNull
(
query
,
"query cannot be null"
);
if
(
query
.
startsWith
(
"g."
))
{
// raw gremlin query
return
searchUsingGremlinQuery
(
query
);
}
JSONObject
response
;
try
{
// fall back to dsl
ParamChecker
.
notEmpty
(
query
,
"query cannot be null"
);
if
(
query
.
startsWith
(
"g."
))
{
// raw gremlin query
return
searchUsingGremlinQuery
(
query
);
}
final
String
jsonResultStr
=
discoveryService
.
searchByDSL
(
query
);
response
=
new
DSLJSONResponseBuilder
().
results
(
jsonResultStr
)
.
query
(
query
)
.
build
();
}
catch
(
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to get entity list for empty query"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
Throwable
throwable
)
{
LOG
.
error
(
"Unable to get entity list for query {} using dsl"
,
query
,
throwable
);
...
...
@@ -99,10 +102,10 @@ public class MetadataDiscoveryResource {
.
query
(
query
)
.
build
();
}
catch
(
DiscoveryException
e
)
{
}
catch
(
DiscoveryException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to get entity list for query {}"
,
query
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get entity list for query {}"
,
query
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
@@ -124,9 +127,8 @@ public class MetadataDiscoveryResource {
@Path
(
"search/dsl"
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
Response
searchUsingQueryDSL
(
@QueryParam
(
"query"
)
String
dslQuery
)
{
Preconditions
.
checkNotNull
(
dslQuery
,
"dslQuery cannot be null"
);
try
{
ParamChecker
.
notEmpty
(
dslQuery
,
"dslQuery cannot be null"
);
final
String
jsonResultStr
=
discoveryService
.
searchByDSL
(
dslQuery
);
JSONObject
response
=
new
DSLJSONResponseBuilder
().
results
(
jsonResultStr
)
...
...
@@ -135,11 +137,11 @@ public class MetadataDiscoveryResource {
return
Response
.
ok
(
response
)
.
build
();
}
catch
(
DiscoveryException
e
)
{
}
catch
(
DiscoveryException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to get entity list for dslQuery {}"
,
dslQuery
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get entity list for dslQuery {}"
,
dslQuery
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
@@ -156,9 +158,8 @@ public class MetadataDiscoveryResource {
@Path
(
"search/gremlin"
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
Response
searchUsingGremlinQuery
(
@QueryParam
(
"query"
)
String
gremlinQuery
)
{
Preconditions
.
checkNotNull
(
gremlinQuery
,
"gremlinQuery cannot be null"
);
try
{
ParamChecker
.
notEmpty
(
gremlinQuery
,
"gremlinQuery cannot be null or empty"
);
final
List
<
Map
<
String
,
String
>>
results
=
discoveryService
.
searchByGremlin
(
gremlinQuery
);
...
...
@@ -176,11 +177,11 @@ public class MetadataDiscoveryResource {
return
Response
.
ok
(
response
)
.
build
();
}
catch
(
DiscoveryException
e
)
{
}
catch
(
DiscoveryException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to get entity list for gremlinQuery {}"
,
gremlinQuery
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get entity list for gremlinQuery {}"
,
gremlinQuery
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
@@ -197,9 +198,8 @@ public class MetadataDiscoveryResource {
@Path
(
"search/fulltext"
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
Response
searchUsingFullText
(
@QueryParam
(
"query"
)
String
query
)
{
Preconditions
.
checkNotNull
(
query
,
"query cannot be null"
);
try
{
ParamChecker
.
notEmpty
(
query
,
"query cannot be null or empty"
);
final
String
jsonResultStr
=
discoveryService
.
searchByFullText
(
query
);
JSONArray
rowsJsonArr
=
new
JSONArray
(
jsonResultStr
);
...
...
@@ -208,10 +208,10 @@ public class MetadataDiscoveryResource {
.
build
();
return
Response
.
ok
(
response
)
.
build
();
}
catch
(
DiscoveryException
e
)
{
}
catch
(
DiscoveryException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to get entity list for query {}"
,
query
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
JSONException
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get entity list for query {}"
,
query
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
...
...
webapp/src/main/java/org/apache/hadoop/metadata/web/resources/TypesResource.java
View file @
84c8636d
...
...
@@ -101,10 +101,14 @@ public class TypesResource {
response
.
put
(
MetadataServiceClient
.
REQUEST_ID
,
Servlets
.
getRequestId
());
response
.
put
(
MetadataServiceClient
.
TYPES
,
typesAddedList
);
return
Response
.
status
(
ClientResponse
.
Status
.
CREATED
).
entity
(
response
).
build
();
}
catch
(
Exception
e
)
{
}
catch
(
MetadataException
|
IllegalArgument
Exception
e
)
{
LOG
.
error
(
"Unable to persist types"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to persist types"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
}
...
...
@@ -122,7 +126,7 @@ public class TypesResource {
final
String
typeDefinition
=
metadataService
.
getTypeDefinition
(
typeName
);
JSONObject
response
=
new
JSONObject
();
response
.
put
(
"typeName"
,
typeName
);
response
.
put
(
MetadataServiceClient
.
TYPENAME
,
typeName
);
response
.
put
(
MetadataServiceClient
.
DEFINITION
,
typeDefinition
);
response
.
put
(
MetadataServiceClient
.
REQUEST_ID
,
Servlets
.
getRequestId
());
...
...
@@ -131,10 +135,14 @@ public class TypesResource {
LOG
.
error
(
"Unable to get type definition for type {}"
,
typeName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
NOT_FOUND
));
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to get type definition for type {}"
,
typeName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get type definition for type {}"
,
typeName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
}
...
...
@@ -165,14 +173,14 @@ public class TypesResource {
response
.
put
(
MetadataServiceClient
.
REQUEST_ID
,
Servlets
.
getRequestId
());
return
Response
.
ok
(
response
).
build
();
}
catch
(
IllegalArgumentException
ie
)
{
}
catch
(
IllegalArgumentException
|
MetadataException
ie
)
{
LOG
.
error
(
"Unsupported typeName while retrieving type list {}"
,
type
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
"Unsupported type "
+
type
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
Exception
e
)
{
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get types list"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
}
}
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