From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:ac8:5e0d:: with SMTP id h13mr26475775qtx.382.1632206987635; Mon, 20 Sep 2021 23:49:47 -0700 (PDT) X-Received: by 2002:a25:8409:: with SMTP id u9mr25396133ybk.159.1632206987468; Mon, 20 Sep 2021 23:49:47 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 20 Sep 2021 23:49:47 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=109.165.123.142; posting-account=niG3UgoAAAD7iQ3takWjEn_gw6D9X3ww NNTP-Posting-Host: 109.165.123.142 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <27364e05-ceac-49de-b6b4-954609d00543n@googlegroups.com> Subject: Re: Exception Handling within Gtkada From: Vadim Godunko Injection-Date: Tue, 21 Sep 2021 06:49:47 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:62802 List-Id: On Monday, September 20, 2021 at 3:06:02 PM UTC+3, ldries46 wrote: > I want an exception to be seen within an existing window of Gtkada to be able to see details of the error. So I used: > > exception > when no_const => > Main_Window.Buffer.Insert_At_Cursor > ("-------------------------------------------------------------------------" > & To_String(CRLF)); > Main_Window.Buffer.Insert_At_Cursor("Error : io_const" & to_String(CRLF)); > end Test_Exception; > > In this case the the program ends and the reason of the exception is lost. I want this only for a selected nr of exceptions. In this case the exception no_const. Generally, Ada exceptions must not left scope of callback function. Thus, such code should be added to each callback/event handler/etc. subprogram of your application.