Submission error handling - ReneRanzinger/glycam.api.client GitHub Wiki

This page summarizes the error handling for the submission webservice. Developers will have to check in multiple places of the response JSON depending on the type of errors. In addition for some errors a job ID is created while in other cases its not. So the job ID itself can not be used to detect if an error occurred or not.

Invalid JSON or missing JSON properties

If an invalid JSON file is submitted or the JSON misses properties an error is added to the entity -> responses -> FrontEndNotices property. The project property is not created:

{
   "entity":{
      "responses":[
         {
            "FrontEndNotice":{
               "type":"error",
               "notice":{
                  "code":"400",
                  "message":"There was a problem parsing the json data: Expecting value: line 1 column 1 (char 0)"
               }
            }
         }
      ]
   }
}

In all cases the code is 400 and errors can be distinguished based on the message.

Invalid GLYCAM sequence

If a GLYCAM sequence is submitted that can not be parsed an error is added to the top level notices array. The project property and pUUID are created:

{
   ...
   "project":{
      "pUUID":"009c16b8-4085-4c7a-93f2-b42cb502740f",
      ...
   },
   "notices":[
      {
         "noticeType":[
            "error"
         ],
         "noticeCode":[
            "400"
         ],
         "noticeBrief":"InvalidInputPayload",
         "noticeMessage":"Cannot create 3D structure as no GLYCAM residue code was found in the GMML metadata for residue: DGlpNAcb",
         "noticeScope":"Transaction",
         "messagingEntity":"CommonServicer",
         "additionalInfo":null
      }
   ]
}

A human readable description of the problem can be found in the noticeMessage property.

GLYCAM internal error

The exact reason for this error is unknown and seems to happen when many structures are submitted. The problem has been reported as in the GLYCAM issue tracker ticket 80. The error is arbitrary and not reproducible. The same GLYCAM sequence submitted at a later time will perform fine.

The error information is added to entity -> responses -> Error. The project property is not created.

{
   "entity":{
      "type":"GRPC",
      "responses":[
         {
            "Error":{
               "respondingService":"JSONServer",
               "notice":{
                  "type":"Exit",
                  "code":"9",
                  "brief":"HaveStderr",
                  "message":"Process returned 0 as exit status, but also returned standard error."
               },
               "options":{
                  "osExitCode":"None",
                  "theStandardError":"b\"terminate called after throwing an instance of 'std::runtime_error'\\n  what():  Linkage numbered 6 not found in linkages for this carbohydrate\\n\\n\"",
                  "theStandardOutput":"b'{\"timestamp\": null, ... []}'",
                  "theExceptionError":"None"
               }
            }
         }
      ]
   }
}

The theStandardOutput property contains an escaped JSON which seems to be in the format of the expected response if no error happens.