Skip to content

Commit cdbad34

Browse files
mgrojodgarske
authored andcommitted
Ada: include use of WolfSSL.Get_Error in the example
1 parent a0c8efd commit cdbad34

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

wrapper/Ada/tls_server.adb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,14 @@ package body Tls_Server with SPARK_Mode is
346346
WolfSSL.Create_WolfSSL (Context => Ctx, Ssl => Ssl);
347347
if not WolfSSL.Is_Valid (Ssl) then
348348
Put_Line ("ERROR: failed to create WOLFSSL object.");
349+
declare
350+
Error_Message : constant WolfSSL.Error_Message :=
351+
WolfSSL.Error (WolfSSL.Get_Error (Ssl, Result));
352+
begin
353+
if Result = Success then
354+
Put_Line (Error_Message.Text (1 .. Error_Message.Last));
355+
end if;
356+
end;
349357
SPARK_Sockets.Close_Socket (L);
350358

351359
if not DTLS then

0 commit comments

Comments
 (0)