Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

...

Expand
title400 Bad Request
400 Bad Request

API Functionality

HTTP Error Code

Existing Error ResponseProposed Error Response

Question Create

400 Bad Request

Code Block
{
    "id": "api.question.create",
    "ver": "3.0",
    "ts": "2023-05-14T14:27:33ZZ",
    "params": {
        "resmsgid": "c34e2d4f-779b-49fc-9d6a-db4466c8de3a",
        "msgid": null,
        "err": "CLIENT_ERROR",
        "status": "failed",
        "errmsg": "Validation Errors"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": [
            "Required Metadata name not set"
        ]
    }
}

Question Create

400 Bad Request

Code Block
{
    "id": "api.question.create",
    "ver": "3.0",
    "ts": "2023-05-14T14:2726:33ZZ17ZZ",
    "params": {
        "resmsgid": "c34e2d4fe45e51ca-779b8c4e-49fc4585-9d6aab03-db4466c8de3a75ab8b131bb5",
        "msgid": null,
        "err": "CLIENT_ERROR",
        "status": "failed",
        "errmsg": "Validation Errors"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "errorsmessages": [
          {

           "identifier": "name",
            "message": "Required Metadata namecode not set"
          }
        ]
    }
}

Question Create

400 Bad Request

Code Block
{
    "id": "api.question.create",
    "ver": "3.0",
    "ts": "2023-05-14T14:26:17ZZ27ZZ",
    "params": {
        "resmsgid": "e45e51ca0020dd04-8c4e65ad-45854e8a-ab039194-75ab8b131bb5bb927025d3e0",
        "msgid": null,
        "err": "CLIENT_ERROR",
        "status": "failed",
        "errmsg": "Validation Errors"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": [
            "Required Metadata codemimeType not set"
        ]
    }
}

Question Create

400 Bad Request

Code Block
{
    "id": "api.question.create",
    "ver": "3.0",
    "ts": "2023-05-14T14:2651:27ZZ49ZZ",
    "params": {
        "resmsgid": "0020dd043814749d-65ad47a0-4e8a4e38-9194a040-bb927025d3e06d32e8e4cbcf",
        "msgid": null,
        "err": "CLIENT_ERROR",
        "status": "failed",
        "errmsg": "Validation Errors"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": [
            "Required Metadata mimeTypeprimaryCategory not set"
        ]
    }
}

Question Create

400 Bad Request

Code Block
{
    "id": "api.question.create",
    "ver": "3.0",
    "ts": "2023-05-14T14:5126:49ZZ35ZZ",
    "params": {
        "resmsgid": "3814749d4ab85c6e-47a03ee4-4e384dc3-a040bcbf-6d32e8e4cbcf0292b734dfdc",
        "msgid": null,
        "err": "CLIENT_ERROR",
        "status": "failed",
        "errmsg": "Validation Errors"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": [
            "Required Metadata primaryCategory not setMetadata mimeType should be one of: [application/vnd.sunbird.question]"
        ]
    }
}

Question CreateUpdate

400 Bad Request

Code Block
{
    "id": "api.question.createupdate",
    "ver": "3.0",
    "ts": "2023-05-14T14:2629:35ZZ03ZZ",
    "params": {
        "resmsgid": "4ab85c6ed43a4913-3ee4d662-4dc34a8a-bcbf8859-0292b734dfdc9add9a04da52",
        "msgid": null,
        "err": "CLIENT_ERROR",
        "status": "failed",
        "errmsg": "ValidationInvalid version ErrorsKey"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": [
            "Metadata mimeType should be one of: [application/vnd.sunbird.question]"null
        ]
    }
}

Question Review

400 Bad Request

Code Block
{
    "id": "api.question.createreview",
    "ver": "3.0",
    "ts": "2023-05-14T14:2630:35ZZ20ZZ",
    "params": {
        "resmsgid": "4ab85c6efd89269b-3ee436f9-4dc34673-bcbf8af4-0292b734dfdcdb41b5f60716",
        "msgid": null,
        "err": "CLIENT_ERRORERR_MANDATORY_FIELD_VALIDATION",
        "status": "failed",
        "errmsg": "Validation ErrorsMandatory Fields [body] Missing for do_21379593928588492814142"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "errorsmessages": [null
          }
}

Question Review

400 Bad Request

Code Block
{
    "id": "api.question.review",
      "identifierver": "mimeType3.0",
            "message": "Metadata mimeType should be one of: [application/vnd.sunbird.question]"
          }
        ]
    }
}

Question Update

400 Bad Request

Code Block
{
    "id": "api.question.update",
    "ver": "3.0",
    "ts": "2023-05-14T14:2930:03ZZ24ZZ",
    "params": {
        "resmsgid": "d43a4913851c2874-d662e6fe-4a8a42b0-88598c4f-9add9a04da5267c234154bc8",
        "msgid": null,
        "err": "CLIENT_ERRORERR_MANDATORY_FIELD_VALIDATION",
        "status": "failed",
        "errmsg": "Invalid version KeyMandatory Fields [responseDeclaration] Missing for do_21379593932446105614143"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

Question Review

400 Bad Request

Code Block
{
    "id": "api.question.updatereview",
    "ver": "3.0",
    "ts": "2023-05-14T14:2930:03ZZ29ZZ",
    "params": {
        "resmsgid": "d43a491323ee2a5c-d6626ad7-4a8a4bae-885980c2-9add9a04da5294d42f82546d",
        "msgid": null,
        "err": "CLIENT_ERRORERR_MANDATORY_FIELD_VALIDATION",
        "status": "failed",
        "errmsg": "Invalid version KeyMandatory Fields [interactions] Missing for do_21379593936168550414144"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "errorsmessages": [
          {
            "identifier": "version key",
            "message": "Invalid version Key"
          }
        ]null
    }
}

Question Review

400 Bad Request

Code Block
{
    "id": "api.question.review",
    "ver": "3.0",
    "ts": "2023-05-14T14:30:20ZZ34ZZ",
    "params": {
        "resmsgid": "fd89269b3de1955f-36f9c480-46734903-8af4ba17-db41b5f6071605e59cf2dc43",
        "msgid": null,
        "err": "ERR_MANDATORY_FIELD_VALIDATION",
        "status": "failed",
        "errmsg": "Mandatory Fields [bodyanswer] Missing for do_2137959392858849281414221379593940282572814145"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

Question Publish

400 Bad Request

Code Block
{
    "id": "api.question.reviewpublish",
    "ver": "3.0",
    "ts": "2023-05-14T14:30:20ZZ56ZZ",
    "params": {
        "resmsgid": "fd89269b3c82e765-36f9b5e0-46734fec-8af48e5e-db41b5f6071687d66f60b323",
        "msgid": null,
        "err": "ERR_MANDATORY_FIELD_VALIDATION",
        "status": "failed",
        "errmsg": "Mandatory Fields [body] Missing for do_2137959392858849281414221379593958717030414146"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "errorsmessages": [
          {
            "identifier": "body",
            "message": "Mandatory Fields [body] Missing for do_21379593928588492814142"
    null
     }
        ]
    }
}

Question ReviewPublish

400 Bad Request

Code Block
{
    "id": "api.question.reviewpublish",
    "ver": "3.0",
    "ts": "2023-05-14T14:3031:24ZZ00ZZ",
    "params": {
        "resmsgid": "851c2874e54e1b92-e6fe98a8-42b046bb-8c4fa27c-67c234154bc8f9790dffd713",
        "msgid": null,
        "err": "ERR_MANDATORY_FIELD_VALIDATION",
        "status": "failed",
        "errmsg": "Mandatory Fields [responseDeclaration] Missing for do_2137959393244610561414321379593961955328014147"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

Question ReviewPublish

400 Bad Request

Code Block
{
    "id": "api.question.reviewpublish",
    "ver": "3.0",
    "ts": "2023-05-14T14:3031:29ZZ04ZZ",
    "params": {
        "resmsgid": "23ee2a5c80ab8746-6ad78455-4bae4d62-80c29bf9-94d42f82546d886bd38851d8",
        "msgid": null,
        "err": "ERR_MANDATORY_FIELD_VALIDATION",
        "status": "failed",
        "errmsg": "Mandatory Fields [interactions] Missing for do_2137959393616855041414421379593964663603214148"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

Question ReviewPublish

400 Bad Request

Code Block
{
    "id": "api.question.reviewpublish",
    "ver": "3.0",
    "ts": "2023-05-14T14:3031:34ZZ07ZZ",
    "params": {
        "resmsgid": "3de1955f7ec01a2a-c4803e35-490346d7-ba178385-05e59cf2dc430dcc81780708",
        "msgid": null,
        "err": "ERR_MANDATORY_FIELD_VALIDATION",
        "status": "failed",
        "errmsg": "Mandatory Fields [answer] Missing for do_2137959394028257281414521379593967552921614149"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

Question PublishList

400 Bad Request

Code Block
{
    "id": "api.questionquestions.publishlist",
    "ver": "3.0",
    "ts": "2023-05-14T14:3031:56ZZ29ZZ",
    "params": {
        "resmsgid": "3c82e765f76b3bb2-b5e005f0-4fec428a-8e5eb0ee-87d66f60b323113609f12b6f",
        "msgid": null,
        "err": "ERR_MANDATORYBAD_FIELD_VALIDATIONREQUEST",
        "status": "failed",
        "errmsg": "MandatoryRequest Fieldscontains [body]invalid Missingidentifiers for: [do_21379593958717030414146_list_abc_123]."
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

Question PublishList

400 Bad Request

Code Block
{
    "id": "api.questionquestions.publishlist",
    "ver": "3.0",
    "ts": "2023-05-14T14:31:00ZZ34ZZ",
    "params": {
        "resmsgid": "e54e1b929edb0e68-98a88a15-46bb4219-a27ca92a-f9790dffd713902efcc786ee",
        "msgid": null,
        "err": "ERR_MANDATORYBAD_FIELD_VALIDATIONREQUEST",
        "status": "failed",
        "errmsg": "MandatoryRequest contains Fieldsinvalid [responseDeclaration]identifiers Missing for: [do_list_abc_234, do_21379593961955328014147list_abc_123]."
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

Question PublishImport

400 Bad Request

Code Block
{
    "id": "api.question.publishimport",
    "ver": "3.0",
    "ts": "2023-05-14T14:3132:04ZZ00ZZ",
    "params": {
        "resmsgid": "80ab8746b71e805f-84555341-4d624e56-9bf993ed-886bd38851d89f57fd293864",
        "msgid": null,
        "err": "ERR_MANDATORYREQUIRED_FIELDPROPS_VALIDATION",
        "status": "failed",
        "errmsg": "MandatoryValidation Fields [interactions] Missing for do_21379593964663603214148"Failed! Mandatory Properties Are [\"name\",\"code\",\"mimeType\",\"framework\",\"channel\"] | Required Property's Missing For [fb1aef22-88e4-4f91-8055-6086bf338bf1]"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

Question PublishImport

400 Bad Request

Code Block
{
    "id": "api.question.publishimport",
    "ver": "3.0",
    "ts": "2023-05-14T14:3132:07ZZ09ZZ",
    "params": {
        "resmsgid": "7ec01a2a6a19eeec-3e35b742-46d74057-8385a782-0dcc81780708c5c1a6a73695",
        "msgid": null,
        "err": "ERR_MANDATORYREAD_FIELD_VALIDATIONSOURCE",
        "status": "failed",
        "errmsg": "Mandatory Fields [answer] Missing for do_21379593967552921614149Received Invalid Response While Reading Data From Source. Response Code is : RESOURCE_NOT_FOUND"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

Question ListReject

400 Bad Request

Code Block
{
    "id": "api.questionsquestion.listreject",
    "ver": "3.0",
    "ts": "2023-05-14T14:3132:29ZZ19ZZ",
    "params": {
        "resmsgid": "f76b3bb21acd73e6-05f0d400-428a492e-b0eeabf5-113609f12b6f5654c3425934",
        "msgid": null,
        "err": "ERR_BADQUESTION_REQUESTREJECT",
        "status": "failed",
        "errmsg": "Request contains invalid identifiers : [do_list_abc_123]."Question is not in 'Review' state for identifier: do_21379594026542694414151"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

Question ListQuestionSet Create

400 Bad Request

Code Block
{
    "id": "api.questionsquestionset.listcreate",
    "ver": "3.0",
    "ts": "2023-05-14T14:3132:34ZZ44ZZ",
    "params": {
        "resmsgid": "9edb0e689ce43dcc-8a1549c6-42194b19-a92a9285-902efcc786ee1e4019bfbf30",
        "msgid": null,
        "err": "ERRCLIENT_BAD_REQUESTERROR",
        "status": "failed",
        "errmsg": "Request contains invalid identifiers : [do_list_abc_234, do_list_abc_123].Validation Errors"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null [
            "Required Metadata name not set"
        ]
    }
}

Question ImportQuestionSet Create

400 Bad Request

Code Block
{
    "id": "api.questionquestionset.importcreate",
    "ver": "3.0",
    "ts": "2023-05-14T14:32:00ZZ53ZZ",
    "params": {
        "resmsgid": "b71e805f6ac7f1cc-5341a41a-4e564bf4-93eda5f7-9f57fd29386449f16beece82",
        "msgid": null,
        "err": "ERR_REQUIRED_PROPS_VALIDATIONCLIENT_ERROR",
        "status": "failed",
        "errmsg": "Validation Failed!Errors"
 Mandatory Properties Are [\"name\",\"code\",\"mimeType\",\"framework\",\"channel\"] | Required Property's Missing For [fb1aef22-88e4-4f91-8055-6086bf338bf1]"
    }, },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "responseCodemessages": "CLIENT_ERROR", [
            "result":Required {Metadata code not set"
     "messages": null   ]
    }
}

Question ImportQuestionSet Create

400 Bad Request

Code Block
{
    "id": "api.questionquestionset.importcreate",
    "ver": "3.0",
    "ts": "2023-05-14T14:32:09ZZ56ZZ",
    "params": {
        "resmsgid": "6a19eeec6a4dc627-b7423593-405749d5-a782adcf-c5c1a6a73695d0c0a077cff6",
        "msgid": null,
        "err": "ERRCLIENT_READ_SOURCEERROR",
        "status": "failed",
        "errmsg": "Received Invalid Response While Reading Data From Source. Response Code is : RESOURCE_NOT_FOUNDValidation Errors"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null[
      } }

Question Reject

400 Bad Request

Code Block
{     "id": "api.question.rejectRequired Metadata mimeType not set"
        ]
    }
}

QuestionSet Update

200 OK

??

QuestionSet Update Hierarchy

400 Bad Request

Code Block
{
    "id": "api.questionset.hierarchy.update",
    "ver": "3.0",
    "ts": "2023-05-14T14:3233:19ZZ44ZZ",
    "params": {
        "resmsgid": "1acd73e6948bf8e0-d400c33c-492e40ed-abf58e69-5654c3425934fdecace00b7d",
        "msgid": null,
        "err": "ERR_INVALID_QUESTIONROOT_REJECTID",
        "status": "failed",
        "errmsg": "QuestionPlease isProvide notValid inRoot 'Review' state for identifier: do_21379594026542694414151Node Identifier"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

QuestionSet CreateReview

400 Bad Request

Code Block
{
    "id": "api.questionset.createreview",
    "ver": "3.0",
    "ts": "2023-05-14T14:3234:44ZZ05ZZ",
    "params": {
        "resmsgid": "9ce43dccf90d747b-49c6be39-4b194fad-9285992c-1e4019bfbf30c5e2c8575806",
        "msgid": null,
        "err": "CLIENT_ERRORERR_MANDATORY_FIELD_VALIDATION",
        "status": "failed",
        "errmsg": "Validation ErrorsMandatory Fields [responseDeclaration] Missing for do_21379594112953548814163"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": [null
            "Required Metadata name not set"
        ]
    }
}
QuestionSet Create
}
}

QuestionSet Publish

400 Bad Request

Code Block
{
    "id": "api.questionset.createpublish",
    "ver": "3.0",
    "ts": "2023-05-14T14:3234:53ZZ33ZZ",
    "params": {
        "resmsgid": "6ac7f1cc25552ef2-a41a1af5-4bf44bbb-a5f780cb-49f16beece82d68b8f229b1f",
        "msgid": null,
        "err": "CLIENT_ERRORERR_MANDATORY_FIELD_VALIDATION",
        "status": "failed",
        "errmsg": "Validation ErrorsMandatory Fields [responseDeclaration] Missing for do_21379594136426086414168"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": [
            "Required Metadata code not set"
        ]
    null
    }
}

QuestionSet CreateRetire

400 Bad Request

Code Block
{
    "id": "api.questionset.createretire",
    "ver": "3.0",
    "ts": "2023-05-14T14:3235:56ZZ05ZZ",
    "params": {
        "resmsgid": "6a4dc627b2e2a370-3593dee4-49d547cb-adcf8fe6-d0c0a077cff6a250cdc70f7c",
        "msgid": null,
        "err": "CLIENT_ERRORERR_QUESTION_SET_RETIRE",
        "status": "failed",
        "errmsg": "ValidationQuestionSet Errors"with identifier : do_21379594162091622414177 is },already Retired."
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": [
            "Required Metadata mimeType not set"
        ]null
    }
}

QuestionSet Update

200 OK

??

QuestionSet Update HierarchyReject

400 Bad Request

Code Block
{
    "id": "api.questionset.hierarchy.updatereject",
    "ver": "3.0",
    "ts": "2023-05-14T14:3338:44ZZ57ZZ",
    "params": {
        "resmsgid": "948bf8e0ff2aac33-c33cc257-40ed487a-8e6985a8-fdecace00b7db44a013e2f71",
        "msgid": null,
        "err": "ERR_INVALIDQUESTION_ROOTSET_IDREJECT",
        "status": "failed",
        "errmsg": "Please Provide Valid Root Node IdentifierQuestionSet is not in 'Review' state for identifier: do_21379594343893401614182"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

QuestionSet ReviewImport

400 Bad Request

Code Block
{
    "id": "api.questionset.reviewimport",
    "ver": "3.0",
    "ts": "2023-05-14T14:3439:05ZZ31ZZ",
    "params": {
        "resmsgid": "f90d747bb8a1999b-be395893-4fad4ef5-992c801d-c5e2c8575806b7c73813119f",
        "msgid": null,
        "err": "ERR_MANDATORYREQUIRED_FIELDPROPS_VALIDATION",
        "status": "failed",
        "errmsg": "MandatoryValidation Fields [responseDeclaration] Missing for do_21379594112953548814163"
    },
    Failed! Mandatory Properties Are [\"name\",\"code\",\"mimeType\",\"framework\",\"channel\"] | Required Property's Missing For [4f85db76-f8c4-41d0-b45c-a8cadba2f618]"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

QuestionSet PublishImport

400 Bad Request

Code Block
{
    "id": "api.questionset.publishimport",
    "ver": "3.0",
    "ts": "2023-05-14T14:3439:33ZZ36ZZ",
    "params": {
        "resmsgid": "25552ef245cd3ffc-1af5205e-4bbb44cd-80cb8017-d68b8f229b1f40804711aa2a",
        "msgid": null,
        "err": "ERR_MANDATORYREAD_FIELD_VALIDATIONSOURCE",
        "status": "failed",
        "errmsg": "Mandatory Fields [responseDeclaration] Missing for do_21379594136426086414168Received Invalid Response While Reading Data From Source. Response Code is : RESOURCE_NOT_FOUND"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

QuestionSet RetireAdd Children

400 Bad Request

Code Block
{
    "id": "api.questionset.retireadd",
    "ver": "3.0",
    "ts": "2023-05-14T14:3539:05ZZ44ZZ",
    "params": {
        "resmsgid": "b2e2a3706f0aa0d2-dee46d4a-47cb4788-8fe68a22-a250cdc70f7c0c68d8bb841a",
        "msgid": null,
        "err": "ERR_QUESTIONBAD_SET_RETIREREQUEST",
        "status": "failed",
        "errmsg": "QuestionSetchildren withare identifiermandatory"
: do_21379594162091622414177 is already Retired."},
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

QuestionSet RejectRemove Children

400 Bad Request

Code Block
{
    "id": "api.questionset.rejectremove",
    "ver": "3.0",
    "ts": "2023-05-14T14:3840:57ZZ01ZZ",
    "params": {
        "resmsgid": "ff2aac33242d2006-c2574e0e-487a49d8-85a88edd-b44a013e2f71725e68fd6a16",
        "msgid": null,
        "err": "ERR_QUESTIONBAD_SET_REJECTREQUEST",
        "status": "failed",
        "errmsg": "QuestionSetchildren is not in 'Review' state for identifier: do_21379594343893401614182are mandatory"
    },
    "responseCode": "CLIENT_ERROR",
    "result": {
        "messages": null
    }
}

QuestionSet Import

404 Not Found400 Bad Request
Expand
title404 Not Found
title

API Functionality

HTTP Error Code

Existing Error Response

Question Create

404 Not Found

Code Block
{
    "id": "api.
questionset
question.
import
create",
    "ver": "3.0",
    "ts": "2023-05-14T14:
39
26:
31ZZ
45ZZ",
    "params": {
        "resmsgid": "
b8a1999b
ae6a0c53-
5893
2e1b-
4ef5
40fd-
801d
8085-
b7c73813119f
7a6463675a5b",
        "msgid": null,
        "err": "
ERR_REQUIRED_PROPS_VALIDATION
404",
        "status": "failed",
        "errmsg": "
Validation Failed! Mandatory Properties Are [\"name\",\"code\",\"mimeType\",\"framework\",\"channel\"] | Required Property's Missing For [4f85db76-f8c4-41d0-b45c-a8cadba2f618]"
Entry is not found in cassandra for content with identifier: obj-cat:random-category-name_question_all {}"
    },
    "responseCode": "
CLIENT
RESOURCE_NOT_
ERROR
FOUND",
    "result": {
        "messages": null
    }
}

QuestionSet Import

Question Read

404 Not Found

Code Block
{
    "id": "api.
questionset
question.
import
read",
    "ver": "3.0",
    "ts": "2023-05-14T14:
39
28:
36ZZ
25ZZ",
    "params": {
        "resmsgid": "
45cd3ffc
f8088bfa-
205e
ba98-
44cd
49d0-
8017
ac9b-
40804711aa2a
8cdc4d15f173",
        "msgid": null,
        "err": "
ERR
NOT_
READ_SOURCE
FOUND",
        "status": "failed",
        "errmsg": "
Received Invalid Response While Reading Data From Source. Response Code is : RESOURCE_NOT_FOUND
Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_1111111"
    },
    "responseCode": "
CLIENT
RESOURCE_NOT_
ERROR400 Bad Request
FOUND",
    "result": {
        "messages": null
    }
}

QuestionSet Add Children

Question Update

404 Not Found

Code Block
{
    "id": "api.
questionset
question.
add
update",
    "ver": "3.0",
    "ts": "2023-05-14T14:
39
30:
44ZZ
11ZZ",
    "params": {
        "resmsgid": "
6f0aa0d2
12a442d1-
6d4a
851b-
4788
4bd4-
8a22
b664-
0c68d8bb841a
878688497a55",
        "msgid": null,
        "err": "
ERR
NOT_
BAD_REQUEST
FOUND",
        "status": "failed",
        "errmsg": "
children are mandatory
Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_abc_123"
    },
    "responseCode": "
CLIENT
RESOURCE_NOT_
ERROR400 Bad Request
FOUND",
    "result": {
        "messages": null
    }
}

QuestionSet Remove Children

Question Review

404 Not Found

Code Block
{
    "id": "api.
questionset
question.
remove
review",
    "ver": "3.0",
    "ts": "2023-05-14T14:
40
30:
01ZZ
41ZZ",
    "params": {
        "resmsgid": "
242d2006
6d9184ee-
4e0e
1cb3-
49d8
4c99-
8edd
acd8-
725e68fd6a16
d05fb764aeca",
        "msgid": null,
        "err": "
ERR
NOT_
BAD_REQUEST
FOUND",
        "status": "failed",
        "errmsg": "
children are mandatory
Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_abcq_1234"
    },
    "responseCode": "
CLIENT
RESOURCE_NOT_
ERROR
FOUND",
    "result": {
        "messages": null
    }
}
Expand

API Functionality

HTTP Error Code

Existing Error Response

Proposed Error Response

Question CreateQuestion Publish

404 Not Found

Code Block
{
    "id": "api.question.createpublish",
    "ver": "3.0",
    "ts": "2023-05-14T14:2631:45ZZ12ZZ",
    "params": {
        "resmsgid": "ae6a0c53486fabc5-2e1b9ca9-40fd40c4-80858aa9-7a6463675a5b48c4c493bc52",
        "msgid": null,
        "err": "404NOT_FOUND",
        "status": "failed",
        "errmsg": "Entry is not found in cassandra for content with identifier: obj-cat:random-category-name_question_all {}Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_abcq_1234"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}

Question Reject

404 Not Found

Code Block
{
    "id": "api.question.createreject",
    "ver": "3.0",
    "ts": "2023-05-14T14:2632:45ZZ24ZZ",
    "params": {
        "resmsgid": "ae6a0c5349b848a4-2e1b17d1-40fd43dd-80859fe8-7a6463675a5b508f224dd6f5",
        "msgid": null,
        "err": "404NOT_FOUND",
        "status": "failed",
        "errmsg": "Entry is not found in cassandra for content with identifier: obj-cat:random-category-name_question_all {}Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_abc_reject_1111"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "errorsmessages": [null
    }
}

QuestionSet Create

404 Not Found

Code Block
{
    {
            "identifier": "obj-cat:random-category-name_question_all",
            "message": "Entry is not found in cassandra for content with identifier: obj-cat:random-category-name_question_all {}"
          }
        ]
    }
}

Question Read

404 Not Found

Code Block
{
    ""id": "api.questionquestionset.readcreate",
    "ver": "3.0",
    "ts": "2023-05-14T14:2833:25ZZ04ZZ",
    "params": {
        "resmsgid": "f8088bfa6b5f76da-ba982fbd-49d0433b-ac9b9660-8cdc4d15f1731d7913be0db6",
        "msgid": null,
        "err": "NOT_FOUND404",
        "status": "failed",
        "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_1111111Entry is not found in cassandra for content with identifier: obj-cat:test-questionset-category_questionset_all {}"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}

Question UpdateQuestionSet Read

404 Not Found

Code Block
{
    "id": "api.questionquestionset.updateread",
    "ver": "3.0",
    "ts": "2023-05-14T14:3033:11ZZ10ZZ",
    "params": {
        "resmsgid": "12a442d19322f6f9-851bda7b-4bd4481f-b6649a67-878688497a55281403c321f5",
        "msgid": null,
        "err": "NOT_FOUND",
        "status": "failed",
        "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: doquestionset_abc123_123invalid"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}

Question ReviewQuestionSet Update

404 Not Found

Code Block
{
    "id": "api.questionquestionset.reviewupdate",
    "ver": "3.0",
    "ts": "2023-05-14T14:3033:41ZZ27ZZ",
    "params": {
        "resmsgid": "6d9184ee0f41b47c-1cb37f8d-4c9946dc-acd887dd-d05fb764aeca171ef4d8bfb6",
        "msgid": null,
        "err": "NOT_FOUND",
        "status": "failed",
        "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: doinvalid_abcqquestionset_1234id"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}

Question PublishQuestionSet Update Hierarchy

404 Not Found

Code Block
{
    "id": "api.questionquestionset.hierarchy.publishupdate",
    "ver": "3.0",
    "ts": "2023-05-14T14:3133:12ZZ49ZZ",
    "params": {
        "resmsgid": "486fabc5d63ee9b1-9ca91a49-40c4455a-8aa9a9a0-48c4c493bc52accd6bc5a036",
        "msgid": null,
        "err": "NOT_FOUND",
        "status": "failed",
        "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_abcqqs_123412345"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}

Question RejectQuestionSet Update Hierarchy

404 Not Found

Code Block
{
    "id": "api.questionset.questionhierarchy.rejectupdate",
    "ver": "3.0",
    "ts": "2023-05-14T14:3233:24ZZ54ZZ",
    "params": {
        "resmsgid": "49b848a4c9fdb65f-17d1a071-43dd41b9-9fe8a0eb-508f224dd6f50f7a160329ee",
        "msgid": null,
        "err": "NOT_FOUND",
        "status": "failed",
        "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_abcq_reject_1111123456"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}

QuestionSet CreateReview

404 Not Found

Code Block
{
    "id": "api.questionset.createreview",
    "ver": "3.0",
    "ts": "2023-05-14T14:3334:04ZZ25ZZ",
    "params": {
        "resmsgid": "6b5f76da8050b405-2fbd6c9f-433b431a-9660a5ed-1d7913be0db62465bd92aa3d",
        "msgid": null,
        "err": "404NOT_FOUND",
        "status": "failed",
        "errmsg": "Entry is not found in cassandra for content with identifier: obj-cat:test-questionset-category_questionset_all {}Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_qs_12345"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}

QuestionSet ReadPublish

404 Not Found

Code Block
{
    "id": "api.questionset.readpublish",
    "ver": "3.0",
    "ts": "2023-05-14T14:3334:10ZZ39ZZ",
    "params": {
        "resmsgid": "9322f6f9c08b8af9-da7b5b03-481f47b0-9a67b2be-281403c321f51a37e840fae0",
        "msgid": null,
        "err": "NOT_FOUND",
        "status": "failed",
        "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: questionsetdo_1231234_invalidpublish"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}

QuestionSet UpdateRead Hierarchy

404 Not Found

Code Block
{
    "id": "api.questionset.updatehierarchy.get",
    "ver": "3.0",
    "ts": "2023-05-14T14:3334:27ZZ47ZZ",
    "params": {
        "resmsgid": "0f41b47cd229d131-7f8dd787-46dc480a-87ddbbfa-171ef4d8bfb62800d59dcb5a",
        "msgid": null,
        "err": "RESOURCE_NOT_FOUND",
        "status": "failed",
        "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: invalid_questionset_id"
    rootId do_21379594147649945614172 does not exist"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}

QuestionSet Update Read Hierarchy

404 Not Found

Code Block
{
    "id": "api.questionset.hierarchy.updateget",
    "ver": "3.0",
    "ts": "2023-05-14T14:3334:49ZZ51ZZ",
    "params": {
        "resmsgid": "d63ee9b13dceeaa5-1a4913ad-455a400a-a9a09470-accd6bc5a036869017e71239",
        "msgid": null,
        "err": "RESOURCE_NOT_FOUND",
        "status": "failed",
        "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: rootId do_qs_12345_123_abc does not exist"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}

QuestionSet Update HierarchyRetire

404 Not Found

Code Block
{
    "id": "api.questionset.hierarchy.updateretire",
    "ver": "3.0",
    "ts": "2023-05-14T14:3335:54ZZ17ZZ",
    "params": {
        "resmsgid": "c9fdb65f995b39d1-a07187fc-41b9439e-a0eb992a-0f7a160329ee397175f77fb9",
        "msgid": null,
        "err": "NOT_FOUND",
        "status": "failed",
        "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_qqs_1234561234"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}

QuestionSet ReviewReject

404 Not Found

Code Block
{
    "id": "api.questionset.reviewreject",
    "ver": "3.0",
    "ts": "2023-05-14T14:3439:25ZZ23ZZ",
    "params": {
        "resmsgid": "8050b405acd9ed0b-6c9f3aec-431a481c-a5edac52-2465bd92aa3d3476b805f099",
        "msgid": null,
        "err": "NOT_FOUND",
        "status": "failed",
        "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_qs_12345123445"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}

QuestionSet PublishAdd Children

404 Not Found

Code Block
{
    "id": "api.questionset.publishadd",
    "ver": "3.0",
    "ts": "2023-05-14T14:3439:39ZZ53ZZ",
    "params": {
        "resmsgid": "c08b8af9673887df-5b038c4d-47b04b84-b2be90d5-1a37e840fae0874f3868d5ce",
        "msgid": null,
        "err": "NOT_FOUND",
        "status": "failed",
        "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_1234qs_publish12333333"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}

QuestionSet Read HierarchyRemove Children

404 Not Found

Code Block
{
    "id": "api.questionset.hierarchy.getremove",
    "ver": "3.0",
    "ts": "2023-05-14T14:3440:47ZZ07ZZ",
    "params": {
        "resmsgid": "d229d131015b90c2-d787bb4c-480a4a24-bbfaa270-2800d59dcb5adba2acf21538",
        "msgid": null,
        "err": "RESOURCE_NOT_FOUND",
        "status": "failed",
        "errmsg": "rootId do_21379594147649945614172 does not existError! Node(s) doesn't Exists. | [Invalid Node Id.]: do_qs_1111223333"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {}
}

QuestionSet Read Hierarchy

404 Not Found

Code Block
{     "id": "api.questionset.hierarchy.get",     "vermessages": "3.0",null
    "ts": "2023-05-14T14:34:51ZZ",
    "params": {
        "resmsgid": "3dceeaa5-13ad-400a-9470-869017e71239",
        "msgid": null,
        "err": "RESOURCE_NOT_FOUND",
        "status": "failed",
        "errmsg": "rootId do_qs_123_abc does not exist"
    },
    "responseCode": "RESOURCE_NOT_FOUND}
}

Proposed Error Response

Solution 1

Recommendation is to use the error standards as specified in the http://jsonapi.org

code: an application-specific error code, expressed as a string value.

title: a short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.

detail: a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.

source: an object containing references to the primary source of the error. It SHOULD include one of the following members or be omitted:

pointer : a JSON Pointer to the value in the request document that caused the error

parameter: a string indicating which URI query parameter caused the error.

header : a string indicating the name of a single request header which caused the error.

Info

Refer - https://jsonapi.org/format/#error-objects

{
Expand
titleSample error structure
Code Block
{
  "errors": [
    {
      "code":   "1000",
      "
result
source": { "pointer": "name" }
}

QuestionSet Retire

404 Not Found

Code Block
,
      "
id
detail": "
api.questionset.retire"
Required Metadata name not set."
    },
    
"ver": "3.0",
{
      "
ts
code": 
"2023-05-14T14:35:17ZZ
  "1001",
      "
params
source": { "pointer": "code" },
      "
resmsgid
detail": "
995b39d1-87fc-439e-992a-397175f77fb9",
Required Metadata code not set."
    },
 
"msgid":
 
null,
  {
      "
err
code":   "
NOT_FOUND
1002",
      "source": { "
status
pointer": "
failed
mimeType" },

      
"
errmsg
detail": "
Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_qs_1234" }, "responseCode": "RESOURCE_NOT_FOUND",
Required Metadata mimeType not set."
    }
  ]
}

Info

We can reserve error codes for the parent category of errors, something like outlined below,

CLIENT_ERROR - 10000 to 20000

RESOURCE_NOT_FOUND - 20001 to 30000

SERVER_ERROR - 30001 to 40000

Info

The Error class will be part of knowlg core

Sample code for exception,

Code Block
throw new ClientException("ERR_INVALID_REQUEST", "A summary of the error", listOfErrors;

Solution 2

Preparing a key / value of the field with the error and corresponding message.

Expand
titleSample error structure
Code Block
{
  "errors": {
      "

...

name" : 

...

"Required Metadata name not set.",
      "

...

code" : 

...

QuestionSet Reject

...

404 Not Found

...

"Required Metadata code not set.",
    

...

  "

...

mimeType" : "

...

Required Metadata mimeType not set."
    }
}

One limitation with this approach is if there are multiple errors to be returned on the same field, then it becomes difficult.

Sample code for exception,

Code Block
throw new 

...

QuestionSet Add Children

...

404 Not Found

...

Code Block
{
    "id": "api.questionset.add",
    "ver": "3.0",
    "ts": "2023-05-14T14:39:53ZZ",
    "params": {
        "resmsgid": "673887df-8c4d-4b84-90d5-874f3868d5ce",
        "msgid": null,
        "err": "NOT_FOUND",
        "status": "failed",
        "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_qs_12333333"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}

...

QuestionSet Remove Children

...

404 Not Found

...

Code Block
{
    "id": "api.questionset.remove",
    "ver": "3.0",
    "ts": "2023-05-14T14:40:07ZZ",
    "params": {
        "resmsgid": "015b90c2-bb4c-4a24-a270-dba2acf21538",
        "msgid": null,
        "err": "NOT_FOUND",
        "status": "failed",
        "errmsg": "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_qs_1111223333"
    },
    "responseCode": "RESOURCE_NOT_FOUND",
    "result": {
        "messages": null
    }
}

Proposed Error Response

Solution 1

Recommendation is to use the error standards as specified in the http://jsonapi.org

code: an application-specific error code, expressed as a string value.

title: a short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.

detail: a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.

source: an object containing references to the primary source of the error. It SHOULD include one of the following members or be omitted:

pointer : a JSON Pointer to the value in the request document that caused the error

parameter: a string indicating which URI query parameter caused the error.

header : a string indicating the name of a single request header which caused the error.

Info

Refer - https://jsonapi.org/format/#error-objects

Expand
titleSample error structure
Code Block
{
  "errors": [
    {
      "code":   "1000",
      "source": { "pointer": "/name" },
      "title":  "Name not set",
      "detail": "Required Metadata name not set."
    },
    {
      "code":   "1001",
      "source": { "pointer": "/code" },
      "title": "Code not set.",
      "detail": "Required Metadata code not set."
    },
    {
      "code":   "1002",
      "source": { "pointer": "/mimeType" },
      "title": "Required Metadata mimeType not set."
    }
  ]
}

Info

We can reserve error codes for the parent category of errors, something like outlined below,

CLIENT_ERROR - 10000 to 20000

RESOURCE_NOT_FOUND - 20001 to 30000

SERVER_ERROR - 30001 to 40000

Solution 2

Preparing a key / value of the field with the error and corresponding message.

Expand
titleSample error structure
Code Block
{
  "errors": {
      "name" : "Required Metadata name not set.",
      "code" : "Required Metadata code not set.",
      "mimeType" : "Required Metadata mimeType not set."
    }
}

...

ClientException("ERR_INVALID_REQUEST", "A summary of the error", mapOfErrors); 

Proposed Error Category and Definitions

Info

ClientException - Can the client recover from an error by fixing the error and resubmitting?

ResourceNotFoundException - The resource that is requested by the client is not found in the server. Client can recover from this error by correcting the mistake if possible.

ServerException - May be a external API call failed. Nothing for the client to fix an resubmit, but in some case can be retried

  •  Recheck if we are using the right exception in the right context

Error Category

HTTP Error Code

Error Sub Category

Error Code

Scenarios Applicable

ERR_INVALID_REQUEST

400

ERR_MANDATORY_FIELD_MISSING

Mandatory attributes are missing or missing values

  • Mandatory fields missing

  • Required fields are not passed

  • Some examples

    • Identifier missing

    • rootId missing

    • childrens are not given

ERR_INVALID_REQUEST

400

ERR_INVALID_PROPERTY_SUPPLIED

1000

When property is invalid or given in wrong place in the request

  • The property inside the request pay load is not recognised by the server

  • The property given is restricted for usage

  • Schema validation errors detected on the properties

  • Some examples

    • Questions requested with children in hierarchy

ERR_INVALID_REQUEST

400

ERR_INVALID_VALUE_SUPPLIED

Request has an invalid value when validating

  • Any validation errors detected on the value supplied

  • Some examples

    • Channel id not matching

    • Identifier supplied is not valid

    • Value supplied is not valid for the key

    • More values supplied than the limit

    • Incorrect children values supplied

    • Invalid identifiers

    • Invalid mimeType

ERR_INVALID_REQUEST

400

ERR_VALUE_CANNOT_BE_EMPTY

1001

In case of conditionally required and not always mandatory

  • Not defined as mandatory, but conditionally needs a value

400

ERR_OPERATION_NOT_PERMITTED

Errors due to the current state of the resource

  • Question visibility is private

  • Question Visibility cannot be Parent

  • Channel id not matching

  • Updating individually for an item whose visibility is parent

  • Sending for a review individually for an item whose visibility is parent

  • Branching logic not expected

  • Invalid visibility

400

ERR_RESOURCE_STATE_INVALID

State or status of the resource is not in the desired form for carrying out the current operation

  • An Object Can't Depend On More Than 1 Object

  • A Dependent Object Can't Have Further Dependent Object

  • Invalid Relation Object Found.

  • Dependent Children Found!

ERR_RESOURCE_NOT_FOUND

404

ERR_RESOURCE_NOT_FOUND

The requested resource is not found in the server

  • Nodes doesn’t exist with the given identifier

  • Source With Identifiers not found

  • Content not found

  • No hierarchy found in Cassandra

ERR_SERVER_EXCEPTION

500

ERR_API_CALL

Exception occurred while making API calls

ERR_SERVER_EXCEPTION

500

ERR_JOB_SUBMISSION

Exception occurred when submitting the jobs

  • Kafka event was not generated properly

ERR_SERVER_EXCEPTION

500

ERR_DATA_STORE

Exception occurred while performing operation against the various data stores

ERR_SERVER_EXCEPTION

500

ERR_DATA_PARSING

Exception occurred while parsing the input data

ERR_SERVER_EXCEPTION

500

ERR_SYSTEM_EXCEPTION

Other exception occurred in the server side