#1 2017-06-12 17:22:18

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

[CLOSED] IsJSON crashing ?

Hello,
On my computer, IsJson generates a crash. I have tested it with the JSON2 example to try just by adding the line to HttpClient Success

// Get the number of recors in the JSON response array

ArrayLength "[HttpClient.Response]" "[TotalRecords]"
IsJSON "[HttpClient.Response]" "[isj]"

Could you please check if it is the same for you ? Thanks

[e] Error: "Exception lifted but not detected" - Line: 306 - Char: 13 - Code: 0 - Url: http://127.0.0.1:9999/app/scripts/app.js
[e] Error: "[$rootScope:inprog] http://errors.angularjs.org/1.6.4/$rootScope/inprog?p0=%24digest" - Line: 141 - Char: 496 - Code: 0 - Url: http://127.0.0.1:9999/builder/scripts/builder.js

CLOSED : Closing. I guess in that example this is an array and the help file speaks about a String... Damn that way of doing things makes me crazy never knowing what comes from which transformation.
Goodbye and sorry

Last edited by svanneste (2017-06-12 17:47:56)

Offline

#2 2017-06-12 17:57:08

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: [CLOSED] IsJSON crashing ?

Hello Samuel,

Certainly the action may induce to error: what the action expected is an string like you suggested, and not an Object or an Array. Probably in this case you can directly check if the response is an Array, or an Object...

Online

#3 2017-06-12 17:58:49

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

Re: [CLOSED] IsJSON crashing ?

You are right, David. I am too used to receive rough strings and after that to manipulate them that I always make the error.

Many thanks for your suggestion smile

Offline

#4 2017-06-12 18:00:28

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: [CLOSED] IsJSON crashing ?

Hello Samuel,

svanneste wrote:

You are right, David. I am too used to receive rough strings and after that to manipulate them that I always make the error.

Many thanks for your suggestion smile

No problem. Just remember that if we receive an JSON object, an Array of Objects, we can start to manipulate it directly using the Http Client's Response variable without the need to convert it or assign it to another variable (if no needed).

Online

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.