comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Lundin" <b.f.lundin@gmail.com>
Subject: Re: GNATCOLL JSON Parsing
Date: Mon, 26 Nov 2018 11:17:49 +0100
Date: 2018-11-26T11:17:49+01:00	[thread overview]
Message-ID: <ptgh8c$447$1@dont-email.me> (raw)
In-Reply-To: <e4e757c5-275c-4bde-bece-4d7dac71c008@googlegroups.com>

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

  reply	other threads:[~2018-11-26 10:17 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-08  5:52 GNATCOLL JSON Parsing eduardsapotski
2018-06-08  9:35 ` Björn Lundin
2018-06-08 10:40 ` eduardsapotski
2018-06-08 12:00 ` Per Sandberg
2018-06-08 15:19 ` eduardsapotski
2018-06-08 15:26   ` Björn Lundin
2018-12-03 15:02   ` Olivier Henley
2018-12-03 18:06     ` Dmitry A. Kazakov
2018-12-03 18:45       ` Olivier Henley
2018-12-03 20:54         ` Dmitry A. Kazakov
2018-12-03 22:01           ` Olivier Henley
2018-12-03 18:06     ` briot.emmanuel
2018-12-03 19:12       ` Olivier Henley
2018-12-03 19:43         ` briot.emmanuel
2018-12-03 20:48           ` Olivier Henley
2018-12-03 20:56             ` Olivier Henley
2018-12-04  7:25             ` briot.emmanuel
2018-12-04 13:39               ` Olivier Henley
2018-12-04 10:14             ` gautier_niouzes
2018-12-04 13:47               ` Olivier Henley
2018-06-08 15:58 ` eduardsapotski
2018-06-08 16:35 ` eduardsapotski
2018-06-08 17:09   ` Björn Lundin
2018-06-09  4:33   ` gautier_niouzes
2018-11-27  6:22   ` Per Sandberg
2018-06-09  4:37 ` gautier_niouzes
2018-06-09  5:08 ` eduardsapotski
2018-06-09  5:31 ` eduardsapotski
2018-06-12  9:55   ` R Srinivasan
2018-06-09  5:35 ` eduardsapotski
2018-11-26  6:42 ` eduardsapotski
2018-11-26 10:17   ` Björn Lundin [this message]
2018-11-26 15:56     ` Simon Wright
2018-11-26 16:11       ` eduardsapotski
2018-11-26 18:01         ` Simon Wright
2018-11-26 20:32           ` Björn Lundin
2018-12-03 18:10   ` Simon Wright
2018-11-26 10:26 ` eduardsapotski
2018-11-26 10:50 ` eduardsapotski
2018-11-26 16:16 ` eduardsapotski
2018-11-27  1:47 ` eduardsapotski
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox