cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to read property '...' at offset '...'

former_member589109
Participant
0 Kudos

Hi, I've got a simple form in my app, which is used to create data in the backend, and there are some not required fields.
If I leave them empty there is no problem with posting data, but whenever I insert anything in these fields and remove it afterward then when I try to save the data the server sends this response:

"message":{"lang":"en","value":"Failed to read property 'email' at offset '108'"}

In SEGW there is:

What can cause this behavior?

maheshpalavalli
Active Contributor

Could you paste the request data from the network tab?

former_member589109
Participant
0 Kudos
--batch_4be8-b416-3342

content-type: multipart/mixed;boundary=changeset_64ca-1a0a-7e8b

--changeset_64ca-1a0a-7e8b

content-type:application/http
content-transfer-encoding:binary

POST ClientHelpSet HTTP/1.1sap-cancel-on-close: true
Content-Type:application/json
sap-contextid-accept:headerAccept:application/json
Accept-Language: en-US
DataServiceVersion:2.0
MaxDataServiceVersion:2.0x-csrf-token:5vJTyjR4rLsopvBXFar-wA==
Content-Length:269{"nip":"98098098","name":"098","city":"098","postal_code":"098","street":"098","house_number":null,"email":null,"telno":null,"country":"08","__metadata":{"type":"<ServiceName>","uri":"<service uri>"}}--changeset_64ca-1a0a-7e8b--
--batch_4be8-b416-3342--

From what I see the data in request all garbage (like country: 08), but these errors are handled right.

former_member589109
Participant
0 Kudos

Just have realized that it happens when the properties are null, but works fine when they are "".

Now it's just to change the code accordingly.

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor

I think now you need to paste your xml view and controller code as well 😄 the requests looks weird and like you said, we need to investigate the junk data.. and especially that null values

BR,

Mahesh

maheshpalavalli
Active Contributor

Yah.. I thought the null values are due to some code. so asked to share the code 🙂

BR,
Mahesh

former_member589109
Participant
0 Kudos

I've just found a piece of code which assigns these values as null and modified it accordingly and it seems to work just fine.
The rest of the junk data is just user input, so no need to worry here, i'll make these input fields more strict in the near future.

Answers (0)