comp.lang.ada
 help / color / mirror / Atom feed
* Interesting AWS error.
@ 2014-12-10  5:15 Shark8
  2014-12-10  8:43 ` Dmitry A. Kazakov
  2014-12-10 12:34 ` Pascal Obry
  0 siblings, 2 replies; 10+ messages in thread
From: Shark8 @ 2014-12-10  5:15 UTC (permalink / raw)


I'm running AWS on windows, built with Pascal's now-disappeared* .bat 
file and [IIRC] with SSL support. I'm getting the following when I try 
feeding an https protocol URL to the AWS.Client.Get subprogram:

raised PROGRAM_ERROR : aws-client.adb:317 finalize/adjust raised exception

The indicated line seems to be a declare-block, literally the word 
'declare'... which makes the PROGRAM_ERROR itself puzzling to me. I 
didn't think that the declare itself could raise PROGRAM_ERROR... or 
that it would be flagged as the trouble-spot.

-------------
* It used to be in the git repo, but I foolishly updated and it was 
deleted. :(  -- If anyone has a copy it would be most appreciated.

-------------

299   function Get
300     (URL                : String;
301      User               : String          := No_Data;
302      Pwd                : String          := No_Data;
303      Proxy              : String          := No_Data;
304      Proxy_User         : String          := No_Data;
305      Proxy_Pwd          : String          := No_Data;
306      Timeouts           : Timeouts_Values := No_Timeout;
307      Data_Range         : Content_Range   := No_Range;
308      Follow_Redirection : Boolean         := False;
309      Certificate        : String          := Default.Client_Certificate;
310      Headers            : Header_List     := Empty_Header_List)
311      return Response.Data
312   is
313      use type Messages.Status_Code;
314
315      Result : Response.Data;
316   begin
317      declare
318         Connection : HTTP_Connection;
319      begin
320         Create (Connection,
321                 URL, User, Pwd, Proxy, Proxy_User, Proxy_Pwd,
322                 Persistent  => False,
323                 Certificate => Certificate,
324                 Timeouts    => Timeouts);
325
326         Get (Connection, Result,
327              Data_Range => Data_Range, Headers => Headers);
328
329         Close (Connection);
330      exception
331         when others =>
332            Close (Connection);
333            raise;
334      end;
335
336      declare
337         SC : constant Messages.Status_Code := Response.Status_Code 
(Result);
338      begin
339         if Follow_Redirection and then SC = Messages.S305 then
340            --  This is "Use Proxy" message, Location point to the 
proxy to
341            --  use. We do not have the login/password for the proxy.
342            return Get
343              (URL, User, Pwd, Response.Location (Result),
344               Timeouts           => Timeouts,
345               Follow_Redirection => Follow_Redirection,
346               Certificate        => Certificate);
347
348         elsif Follow_Redirection
349           and then SC in Messages.Redirection
350           and then SC /= Messages.S300 -- multiple choices
351           and then SC /= Messages.S304 -- not modified, no redirection
352         then
353            return Get
354              (Response.Location (Result), User, Pwd,
355               Proxy, Proxy_User, Proxy_Pwd, Timeouts,
356               Data_Range, Follow_Redirection, Certificate => 
Certificate);
357         else
358            return Result;
359         end if;
360      end;
361   end Get;


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-12-10 21:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-10  5:15 Interesting AWS error Shark8
2014-12-10  8:43 ` Dmitry A. Kazakov
2014-12-10 15:26   ` Shark8
2014-12-10 15:41     ` Dmitry A. Kazakov
2014-12-10 12:34 ` Pascal Obry
2014-12-10 15:21   ` Shark8
2014-12-10 15:30     ` Pascal Obry
2014-12-10 16:30       ` Shark8
2014-12-10 19:39         ` Shark8
2014-12-10 21:11           ` Pascal Obry

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