cancel
Showing results for 
Search instead for 
Did you mean: 

UI5 Mockserver with INVALID_STATE_ERR - 4

06-14-2022 5:03 AM
NeoXie Product and Topic Expert
1221 views 2 comments Go to solution
SAP Managed Tags
Subscribe

Hi colleagues,

I use function fnMergeAfter = function (oEvent) and oMockServer.attachAfter("MERGE", fnMergeAfter, "C_SlsPricingConditionRecordTP") to send response with sap-message when APP merge data.

However, APP sucessfully get the sap-message but will have error: INVALID_STATE_ERR - 4,

sinon.js:184 Uncaught Error: INVALID_STATE_ERR - 4
at k (sinon.js:184:3467)
at F.w [as setResponseHeaders] (sinon.js:184:6351)
at F.x [as respond] (sinon.js:184:8488)
at Object.response (MockServer-dbg.js:3236:16)
at F.b (sinon.js:196:852)
at F.n [as processRequest] (sinon.js:196:2451)
at F.i [as handleRequest] (sinon.js:196:1681)
at x.onSend (sinon.js:196:1207)
at F.x [as send] (sinon.js:184:7014)
at Object.send (jquery-dbg.js:10224:9)

I just add the message in oEvent as below:

oEvent.getParameters().oXhr.respondJSON(200, {"sap-message": sReturnMsg},

JSON.stringify({

d: oEvent.getParameter("oEntity")

}));


The comparation between working one and error one is as below (ready state 1 is working, but if add response, it changes to ready state 4):

Could any mock server expert provide any ideas or solution to provide message when MERGE request comes?

Thanks in advance for your support!

Br,

Neo

Accepted Solutions (1)

Accepted Solutions (1)

NeoXie
Product and Topic Expert
Product and Topic Expert
0 Likes

issue resolved. By hardcode the status to 1, at the end of your functionality.

Answers (0)