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
Request clarification before answering.
issue resolved. By hardcode the status to 1, at the end of your functionality.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.