...
...
This document explains about the various error responses the inQuiry micro service currently throws. The intent of this document is to look through the errors and classify it and propose any changes in terms of error reporting.
Broadly classified, there are three types of error responses that are coming out of the APIs.
...
Expand | |||
---|---|---|---|
| |||
Error Code
| Error Message | Thrown by? | |
ERR_API_CALL | Something Went Wrong While Making API Call | Error is: ?? | Knowlg Core | |
ERR_QUESTION_CREATE | Visibility cannot be Parent! | inQuiry | |
ERR_QUESTION_SET_CREATE | Visibility cannot be Parent! | inQuiry | |
ERR_ACCESS_DENIED | ?? visibility is private, hence access denied | inQuiry | |
ERR_INVALID_CHANNEL | Please Provide Channel! | inQuiry | |
ERR_ACCESS_DENIED | Channel id is not matched | inQuiry | |
ERR_QUESTION_UPDATE | ?? with visibility Parent, can't be updated individually. | inQuiry | |
ERR_QUESTION_SET_UPDATE | ?? with visibility Parent, can't be updated individually. | inQuiry | |
ERR_QUESTION_SET_REVIEW | ?? with visibility Parent, can't be sent for review individually. | inQuiry | |
ERR_QUESTION_SET_REVIEW | ?? with status other than Draft can't be sent for review. | inQuiry |
Code Block |
---|
ERROR_RESTRICTED_PROP", "Properties in list " + restrictedProps.mkString("[", ", ", "] + " are not allowed in request
ErrorCodes.ERR_BAD_REQUEST.name(), s"Request Body cannot be Empty.
ErrorCodes.ERR_BAD_REQUEST.name(), s"Cannot update content status to
ErrorCodes.ERR_BAD_REQUEST.name(), "Required field identifier is missing or empty.
ErrorCodes.ERR_BAD_REQUEST.name(), "Request contains more than the permissible limit of identifiers
AssessmentConstants.ERR_INVALID_OBJECT_TYPE, s"Please Provide Valid ${requestObjectType} Identifier
AssessmentConstants.ERR_INVALID_REQUEST, "Question With Visibility Parent Cannot Be Copied Individually!
AssessmentConstants.ERR_INVALID_REQUEST, "Please provide valid value for " + keysNotPresent)
AssessmentConstants.ERR_INVALID_REQUEST, "QuestionSet With Status " + node.getMetadata.get(AssessmentConstants.STATUS).asInstanceOf[String].toLowerCase + " Cannot Be Partially (Shallow) Copied.
errCode, "Visibility cannot be Parent!
ERR_ACCESS_DENIED", s"$resName visibility is private, hence access denied
ERR_INVALID_CHANNEL", "Please Provide Channel!
ERR_ACCESS_DENIED", "Channel id is not matched
errCode, node.getMetadata.getOrDefault("objectType", ".asInstanceOf[String].replace("Image", " + " with visibility Parent, can't be updated individually.
errCode, s"${node.getObjectType.replace("Image", "} with visibility Parent, can't be sent for review individually.
errCode, s"${node.getObjectType.replace("Image", "} with status other than Draft can't be sent for review.
errCode, s"${node.getObjectType.replace("Image", "} with visibility Parent, can't be sent for review individually.
errCode, s"${node.getObjectType.replace("Image", "} with status other than Draft can't be sent for review.
ERR_MANDATORY_FIELD_VALIDATION", s"Mandatory Fields ${messages.asJava} Missing for ${node.getIdentifier.replace(".img", "}
errCode, s"${node.getObjectType.replace("Image", "} with visibility Parent, can't be sent for publish individually.
errCode, s"${node.getObjectType.replace("Image", "} having Processing status can't be sent for publish.
errCode, s"${node.getObjectType.replace("Image", "} with visibility Parent, can't be sent for publish individually.
errCode, s"${node.getObjectType.replace("Image", "} having Processing status can't be sent for publish.
ERR_MANDATORY_FIELD_VALIDATION", s"Mandatory Fields ${messages.asJava} Missing for ${node.getIdentifier.replace(".img", "}
errCode, s"${node.getObjectType.replace("Image", "} with identifier
errCode, s"${node.getObjectType.replace("Image", "} with visibility Parent, can't be sent for reject individually.
errCode, s"${node.getObjectType.replace("Image", "} is not in 'Review' state for identifier
ERR_QUESTION_SET_ADD", "Node with Identifier " + node.getIdentifier + " is not a Question Set
ERR_QUESTION_SET", "Object with identifier
ERR_MANDATORY_FIELD_VALIDATION", s"Mandatory Fields ${messages.asJava} Missing for ${content.get("identifier.toString}
BE_JOB_REQUEST_EXCEPTION", "Event is not generated properly.
ERR_BRANCHING_LOGIC", s"Branching Is Not Enabled For ${rootNode.getIdentifier}. Please Enable Branching Or Remove branchingLogic from Request.
ErrorCodes.ERR_BAD_REQUEST.name(), "rootId is mandatory
ErrorCodes.ERR_BAD_REQUEST.name(), "children are mandatory
ErrorCodes.ERR_BAD_REQUEST.name(), "Branch Rule Found For The Node Which Is Not A Children Having Identifier
ErrorCodes.ERR_BAD_REQUEST.name(), "Children which are not available are
ErrorCodes.ERR_BAD_REQUEST.name(), s"Children must be of types $ASSESSMENT_OBJECT_TYPES for ids
ERR_BRANCHING_LOGIC", s"Branching Is Not Enabled For ${unitId}. Please Enable Branching Or Remove branchingLogic from Request.
ERR_BRANCHING_LOGIC", s"Dependent Children Found! Please Remove Children With Identifiers ${target} For Node
ERR_BRANCHING_LOGIC", s"Source With Identifiers ${sourceIds.diff(childrenIds).asJava} Not Found! Please Provide Valid Source Identifier.
ERR_BRANCHING_LOGIC", "An Object Can't Depend On More Than 1 Object
ERR_BRANCHING_LOGIC", s"${source.get(0)} Is Already Children Of ${pSource.get(0)}. So It Can't Be Parent For ${entry._1}
ErrorCodes.ERR_BAD_REQUEST.name(), "Hierarchy data is empty
ERR_QS_UPDATE_HIERARCHY", "Question cannot have children in hierarchy
HierarchyErrorCodes.ERR_INVALID_ROOT_ID, "Please Provide Valid Root Node Identifier
HierarchyErrorCodes.ERR_INVALID_ROOT_ID, "Invalid MimeType for Root Node Identifier
HierarchyErrorCodes.ERR_INVALID_ROOT_ID, "Invalid Visibility found for Root Node Identifier
ERR_UPDATE_QS_HIERARCHY", s"Object Type is mandatory for creation of node with id
ERR_UPDATE_QS_HIERARCHY", s"Visibility can be only of type Parent for identifier
ERR_UPDATE_QS_HIERARCHY", s"Visibility can be only of type ${HierarchyConstants.QUESTION_VISIBILITY.asJava} for identifier
ERR_BRANCHING_LOGIC", s"Branching Is Not Enabled For
ERR_BRANCHING_LOGIC", s"Please Provide Branching Rules for
ERR_BRANCHING_LOGIC", s"Please Provide Dependent Object Within Same Parent having identifier
ERR_BRANCHING_LOGIC", "An Object Can't Depend On More Than 1 Object
ERR_BRANCHING_LOGIC", "A Dependent Object Can't Have Further Dependent Object |
title | ResourceNotFoundException |
---|
Error Code
Error Message
title | ServerException |
---|
Error Code
Error Message
ERR_QUESTION_SET_HIERARCHY
No hierarchy is present in cassandra for identifier: ??
ERR_QUESTIONSET_COPY
Something Went Wrong, Please Try Again
ERR_WHILE_FETCHING_HIERARCHY_FROM_CASSANDRA
Error while fetching hierarchy from cassandra
SERVER_ERROR
Invalid response from search
ERR_HIERARCHY_NOT_FOUND
No hierarchy is present in cassandra for identifier: ??
ERR_SYSTEM_EXCEPTION
Exception Occurred While Saving The Record. Exception is : ??
ERR_SYSTEM_EXCEPTION
Exception Occurred While Reading The Record. Exception is : ??
ERR_GRAPH_PROCESSING_ERROR
Unable To Fetch Nodes From Graph. Exception is: ??
ERR_INVALID_REQUEST_BODY
Request Body is Missing!
ERR_API_CALL
Something Went Wrong While Making API Call | Error is: ??
ERR_INVALID_URL
Url Parameter is Missing!
ERR_INVALID_HEADER_PARAM
Header Parameter is Missing!
ERR_DATA_PARSER
Unable to parse data! | Error is: ??
ERR_KEYSPACE_NOT_DEFINED
| ||
Class
ServerException
Usages in All Places (56 usages found)
Local variable declaration (1 usage found)
Maven: org.sunbird:platform-common:1.0-SNAPSHOT (1 usage found)
org.sunbird.common.exception (1 usage found)
ServerExceptionTest (1 usage found)
testServerException_6() (1 usage found)
37 ServerException exception = new ServerException(ErrorCodes.ERR_SYSTEM_EXCEPTION.name(), "Failed to create node object. Node from database is null.", new Throwable("message throwable"));
New instance creation (30 usages found)
assessment-actors (3 usages found)
org.sunbird.managers (3 usages found)
AssessmentManager.scala (1 usage found)
207 } else throw new ServerException("ERR_QUESTION_SET_HIERARCHY", "No hierarchy is present in cassandra for identifier:" + rootNode.getIdentifier)
CopyManager.scala (2 usages found)
107 throw new ServerException("ERR_QUESTIONSET_COPY", "Something Went Wrong, Please Try Again")
116 throw new ServerException("ERR_QUESTIONSET_COPY", "Something Went Wrong, Please Try Again")
qs-hierarchy-manager (4 usages found)
org.sunbird.managers (4 usages found)
HierarchyManager.scala (3 usages found)
488 throw new ServerException("ERR_WHILE_FETCHING_HIERARCHY_FROM_CASSANDRA", "Error while fetching hierarchy from cassandra")
493 throw new ServerException("ERR_WHILE_FETCHING_HIERARCHY_FROM_CASSANDRA", "Error while fetching hierarchy from cassandra")
575 throw new ServerException("SERVER_ERROR", "Invalid response from search")
UpdateHierarchyManager.scala (1 usage found)
128 throw new ServerException(HierarchyErrorCodes.ERR_HIERARCHY_NOT_FOUND, "No hierarchy is present in cassandra for identifier:" + rootNode.getIdentifier)
Maven: org.sunbird:graph-engine_2.11:1.0-SNAPSHOT (9 usages found)
src.main.scala.org.sunbird.graph.external.store (5 usages found)
ExternalStore.scala (5 usages found)
49 throw new ServerException(ErrorCodes.ERR_SYSTEM_EXCEPTION.name, "Exception Occurred While Saving The Record. Exception is : " + e.getMessage)
92 throw new ServerException(ErrorCodes.ERR_SYSTEM_EXCEPTION.name, "Exception Occurred While Reading The Record. Exception is : " + e.getMessage)
110 throw new ServerException(ErrorCodes.ERR_SYSTEM_EXCEPTION.name, "Exception Occurred While Reading The Record. Exception is : " + e.getMessage)
150 throw new ServerException(ErrorCodes.ERR_SYSTEM_EXCEPTION.name, "Exception Occurred While Reading The Record. Exception is : " + e.getMessage)
181 throw new ServerException(ErrorCodes.ERR_SYSTEM_EXCEPTION.name, "Exception Occurred While Saving The Record. Exception is : " + e.getMessage)
src.main.scala.org.sunbird.graph.relations (2 usages found)
AbstractRelation.scala (1 usage found)
66 throw new ServerException(GraphErrorCodes.ERR_RELATION_VALIDATE.toString, "Error occurred while validating the relation", e)
SequenceMembershipRelation.scala (1 usage found)
25 throw new ServerException(GraphErrorCodes.ERR_RELATION_VALIDATE.toString, e.getMessage, e)
src.main.scala.org.sunbird.graph.schema (1 usage found)
CategoryDefinitionValidator.scala (1 usage found)
65 } else throw new ServerException(resp.getParams.getErr, resp.getParams.getErrmsg + " " + resp.getResult)
src.main.scala.org.sunbird.graph.schema.validator (1 usage found)
FrameworkValidator.scala (1 usage found)
152 throw new ServerException("ERR_GRAPH_PROCESSING_ERROR", "Unable To Fetch Nodes From Graph. Exception is: " + e.getMessage)
Maven: org.sunbird:platform-common:1.0-SNAPSHOT (13 usages found)
org.sunbird.common (7 usages found)
HttpUtil (7 usages found)
post(String, Map<String, Object>, Map<String, String>) (2 usages found)
33 throw new ServerException("ERR_INVALID_REQUEST_BODY", "Request Body is Missing!");
38 throw new ServerException("ERR_API_CALL", "Something Went Wrong While Making API Call | Error is: " + e.getMessage());
get(String, String, Map<String, String>) (1 usage found)
58 throw new ServerException("ERR_API_CALL", "Something Went Wrong While Making API Call | Error is: " + e.getMessage());
getMetadata(String, Map<String, String>) (1 usage found)
84 throw new ServerException("ERR_API_CALL", "Something Went Wrong While Making API Call | Error is: " + e.getMessage());
validateRequest(String, Map<String, String>) (2 usages found)
90 throw new ServerException("ERR_INVALID_URL", "Url Parameter is Missing!");
92 throw new ServerException("ERR_INVALID_HEADER_PARAM", "Header Parameter is Missing!");
getResponse(HttpResponse<String>) (1 usage found)
100 throw new ServerException("ERR_DATA_PARSER", "Unable to parse data! | Error is: " + e.getMessage());
org.sunbird.common.exception (6 usages found)
ServerExceptionTest (6 usages found)
testServerException_1() (1 usage found)
11 throw new ServerException(ResponseCode.SERVER_ERROR.name(), "Failed to create node object. Node from database is null.");
testServerException_2() (1 usage found)
16 throw new ServerException(ErrorCodes.ERR_SYSTEM_EXCEPTION.name(), "Failed to create node object. Node from database is null.", Arrays.asList("Message one ", "message 2"));
testServerException_3() (1 usage found)
21 throw new ServerException(ErrorCodes.ERR_SYSTEM_EXCEPTION.name(), "Failed to create node object. Node from database is null.", "message1", "message2");
testServerException_4() (1 usage found)
26 throw new ServerException(ErrorCodes.ERR_SYSTEM_EXCEPTION.name(), "Failed to create node object. Node from database is null.", new Throwable("message throwable"), "message1", "message2");
testServerException_5() (1 usage found)
32 throw new ServerException(ErrorCodes.ERR_SYSTEM_EXCEPTION.name(), "Failed to create node object. Node from database is null.", new Throwable("message throwable"));
testServerException_6() (1 usage found)
37 ServerException exception = new ServerException(ErrorCodes.ERR_SYSTEM_EXCEPTION.name(), "Failed to create node object. Node from database is null.", new Throwable("message throwable"));
Maven: org.sunbird:schema-validator:1.0-SNAPSHOT (1 usage found)
org.sunbird.schema (1 usage found)
SchemaValidatorFactory (1 usage found)
getExternalStoreName(String, String) (1 usage found)
39 throw new ServerException("ERR_KEYSPACE_NOT_DEFINED", "Key space for " + name + " is not configured.");
Usage in .class (10 usages found)
Maven: org.sunbird:platform-common:1.0-SNAPSHOT (9 usages found)
org.sunbird.common (4 usages found)
HttpUtilTest (4 usages found)
testValidateRequestWithEmptyUrl() (1 usage found)
50 @Test(expected = ServerException.class)
testValidateRequestWithEmptyHeader() (1 usage found)
60 @Test(expected = ServerException.class)
testPostWithInvalidRequest() (1 usage found)
93 @Test(expected = ServerException.class)
testGetResponseWithInvalidBody() (1 usage found)
140 @Test(expected = ServerException.class)
org.sunbird.common.exception (5 usages found)
ServerExceptionTest (5 usages found)
testServerException_1() (1 usage found)
9 @Test(expected = ServerException.class)
testServerException_2() (1 usage found)
14 @Test(expected = ServerException.class)
testServerException_3() (1 usage found)
19 @Test(expected = ServerException.class)
testServerException_4() (1 usage found)
24 @Test(expected = ServerException.class)
testServerException_5() (1 usage found)
30 @Test(expected = ServerException.class)
Maven: org.sunbird:schema-validator:1.0-SNAPSHOT (1 usage found)
org.sunbird.schema (1 usage found)
TestSchemaValidatorFactory (1 usage found)
getExternalStoreNameInvalid() (1 usage found)
44 @Test(expected = ServerException.class)
Usage in import (14 usages found)
assessment-actors (2 usages found)
org.sunbird.managers (2 usages found)
AssessmentManager.scala (1 usage found)
8 import org.sunbird.common.exception.{ClientException, ResourceNotFoundException, ServerException}
CopyManager.scala (1 usage found)
8 import org.sunbird.common.exception.{ClientException, ServerException}
qs-hierarchy-manager (2 usages found)
org.sunbird.managers (2 usages found)
HierarchyManager.scala (1 usage found)
10 import org.sunbird.common.exception.{ClientException, ErrorCodes, ResourceNotFoundException, ResponseCode, ServerException}
UpdateHierarchyManager.scala (1 usage found)
9 import org.sunbird.common.exception.{ClientException, ErrorCodes, ResourceNotFoundException, ServerException}
Maven: org.sunbird:graph-engine_2.11:1.0-SNAPSHOT (5 usages found)
src.main.scala.org.sunbird.graph.external.store (1 usage found)
ExternalStore.scala (1 usage found)
14 import org.sunbird.common.exception.{ErrorCodes, ResponseCode, ServerException}
src.main.scala.org.sunbird.graph.relations (2 usages found)
AbstractRelation.scala (1 usage found)
5 import org.sunbird.common.exception.{MiddlewareException, ServerException}
SequenceMembershipRelation.scala (1 usage found)
5 import org.sunbird.common.exception.ServerException
src.main.scala.org.sunbird.graph.schema (1 usage found)
CategoryDefinitionValidator.scala (1 usage found)
11 import org.sunbird.common.exception.{ResourceNotFoundException, ResponseCode, ServerException}
src.main.scala.org.sunbird.graph.schema.validator (1 usage found)
FrameworkValidator.scala (1 usage found)
10 import org.sunbird.common.exception.{ClientException, ResourceNotFoundException, ServerException}
Maven: org.sunbird:platform-common:1.0-SNAPSHOT (3 usages found)
org.sunbird.common (3 usages found)
HttpUtil (1 usage found)
11 import org.sunbird.common.exception.ServerException;
HttpUtilTest (1 usage found)
21 import org.sunbird.common.exception.ServerException;
HttpUtilTests (1 usage found)
5 import org.sunbird.common.exception.ServerException;
Maven: org.sunbird:schema-validator:1.0-SNAPSHOT (2 usages found)
org.sunbird.schema (2 usages found)
SchemaValidatorFactory (1 usage found)
5 import org.sunbird.common.exception.ServerException;
TestSchemaValidatorFactory (1 usage found)
7 import org.sunbird.common.exception.ServerException;
Usage in instanceof (1 usage found)
Maven: org.sunbird:platform-common:1.0-SNAPSHOT (1 usage found)
org.sunbird.common.dto (1 usage found)
ResponseHandler (1 usage found)
setResponseCode(Response, Throwable) (1 usage found)
176 } else if (e instanceof ServerException) { |
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
API Error Responses from inQuiry microservice
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
...