![]() |
EAggregateException
Da keine Dokumentation zu
![]() ![]() Zitat:
Delphi-Quellcode:
uses System.Threading;
procedure processData(const input: Integer); begin if Odd(input) then raise EProgrammerNotFound.CreateFmt('Error while processing "%d"', [input]); end; procedure doStuff(); var exceptions: TArray<Exception>; i: Integer; begin exceptions := []; for i := 0 to 5 do try processData(i); except exceptions := exceptions + [Exception(AcquireExceptionObject())]; Continue; end; case Length(exceptions) of 0: Exit; 1: raise exceptions[0]; else raise EAggregateException.Create('Calculations failed', exceptions); end; end; |
AW: EAggregateException
Die "Doku" zu EAggregateException ist ja echt ziemlich peinlich. Vermutlich hat Embarcadero inzwischen vergessen, dass es die gar nicht gibt.
So, wie ich den Code verstehe, hast Du recht: Es spricht absolut nicths dagegen, sie so zu verwenden, wie in Deinem Beispiel. Man braucht dann natürlich auch einen sinnvollen Exception-Handler dafür. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:31 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz