From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?Bj=c3=b6rn_Lundin?= Newsgroups: comp.lang.ada Subject: Re: GNATCOLL JSON Parsing Date: Mon, 26 Nov 2018 11:17:49 +0100 Organization: A noiseless patient Spider Message-ID: References: <9524b3ee-476f-4af6-ab83-b15a6c2a417c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 26 Nov 2018 10:17:48 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="a9661274bb099af69fea4cf699e87b6b"; logging-data="4231"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18yMKOjd/ZI1ytUCd2X6+pw" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 Cancel-Lock: sha1:qtt596bSuNieE5vx7B4js7EhlA8= In-Reply-To: Content-Language: sv-FI Xref: reader01.eternal-september.org comp.lang.ada:54893 Date: 2018-11-26T11:17:49+01:00 List-Id: On 2018-11-26 07:42, eduardsapotski@gmail.com wrote: > Again problem ... > I'm trying parse such result: https://api.exmo.com/v1/pair_settings/ > > > raised CONSTRAINT_ERROR : gnatcoll-json.adb:1328 discriminant check failed > > Björn, hope only on you :)) I doubt that. Anyway, I re-wrote towith Gnatcoll.Json; use Gnatcoll.Json; with Aws; with Aws.Client; with Aws.Response; with Ada.Text_IO; use Ada.Text_IO; with Gnatcoll.Json; use Gnatcoll.Json; procedure Test_Json is Json_Main_Node : Json_Value := Create; Json_Result_Array : Json_Array := Empty_Array; Aws_Reply : Aws.Response.Data; begin Aws_Reply := Aws.Client.Get (Url => "https://api.exmo.com/v1/pair_settings"); Json_Main_Node := Read (Strm => Aws.Response.Message_Body(Aws_Reply), Filename => ""); Json_Result_Array := Get(Json_Main_Node); if Length(Json_Result_Array) > 0 then for I in 1 .. Length(Json_Result_Array) loop Put_Line( "123" ); end loop; end if; end Test_Json; But I get a bnl@sebjlun-deb64:~/bnlbot/botstart/bot-1-0/target/bin$ ./test_json Execution terminated by unhandled exception raised PROGRAM_ERROR : aws-client.adb:391 finalize/adjust raised exception Call stack traceback locations: 0x5efe79 0x407823 0x4094a8 0x7fa59ae762af 0x407208 0xfffffffffffffffe bnl@sebjlun-deb64:~/bnlbot/botstart/bot-1-0/target/bin$ addr2line -e test_json 0x5efe79 0x407823 0x4094a8 0x7fa59ae762af 0x407208 0xfffffffffffffffe ??:? /home/bnl/bnlbot/botstart/bot-1-0/source/ada/local/utils/test_json.adb:11 /home/bnl/bnlbot/botstart/bot-1-0/target/objects/bot/b__test_json.adb:1051 ??:0 ??:? ??:0 bnl@sebjlun-deb64:~/bnlbot/botstart/bot-1-0/target/bin$ So my version crashes on AWS.Client.Get I cannot really help you further here Where does you client crash? what line is 1328? -- -- Björn