Dealing with the AggregateException thrown when calling task.Wait().

I am new to the Task facility and am curious on best practice here. I am dispatching tasks something like:
Task task = Task.Run(
() =>
try
this.MyMethod(paramA, paramB);
catch
taskCancellationTokenSource.Cancel();
throw;
finally
semaphore.Release();
So if needed, the cancellation token can end things quickly and drop me quicker into the final bit of cleanup:
foreach (Task task in tasks)
try
task.Wait();
catch (AggregateException e)
foreach (Exception ie in e.InnerExceptions)
Logger...
throw;
catch (Exception e)
Logger...
throw;
Obviously this brings out only the first nested exception. What is the general way of handling this? How should rethrow in this scenario allowing me to log and track everything that may have occurred?
Thanks!

Hi
Ritmo2k,
>>Obviously this brings out only the first nested exception. What is the general way of handling this? How should rethrow in this scenario allowing me to log and track everything that may have occurred?
Per my understanding, you could catch System.Exception and switch on the types
catch (Exception ex)
if (ex is Exception || ex is AggregateException)
Logger...
return;
throw;
Best regards,
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • What's the deal with the swoosh sound when sending texts? IOS 5.1 needs to have an option to turn it off., What's the deal with the swoosh sound when sending texts? IOS 5.1 needs to have an option to turn it off.

    What's the deal with the swoosh sound when sending texts? IOS 5.1 needs to have an option to turn it off., What's the deal with the swoosh sound when sending texts? IOS 5.1 needs to have an option to turn it off.

    Trax and kirt are correct. I'm pretty good with technology, being an engineer and all, and I can tell you for a fact that this 'swoosh' sound (triggered by a successfully sent SMS) can NOT be disabled from ANY menu in iOS 5. The ONLY way to disable it is to flip the silent switch on the left hand side of the phone. This is extremely annoying for some people (like trax, kirt, and myself). For what we pay for Apple products and, in particular, this phone, we simply didn't expect to have to deal with such annoyances. That's why we're Mac users. Please fix this bug.
    I feel like I shouldn't have to say this but it bears repeating: turning off message sounds from the 'sounds' menu does not fix his problem. It still emits the swoosh noise. Whoever suggested this clearly didn't try it because it obviously doesn't work. Who posts a solution to a problem without knowing for a fact that their solution is correct? I find that response condescending because he writer is assuming we're not smart enough to have tried it. In reality, it's vice versa.

  • What is the deal with the crazy zooming when I drag the playhead??

    What is the deal with the zooming in with the dragging of the playhead??? I'm sure I can adjust/turn off this feature in the preferences. How could i use this to benefit me? How would it? It seems so spastically erratic!

    I use it quite a bit for zooming in and out (by dragging up and down) but you have to be careful you don't move left or right when doing this as it then becomes a bit unpredictable as you say...
    If you just want to use the playhead for dragging left and right (and if you can't find a pref to turn it off) you'll just have to be careful to drag only in the horizontal axis and not up or down..
    Cheers
    Robo

  • How to deal with complex SOAP responses when calling web services ???

    Hi all,
    I have an issue when calling a web service that returns a complex
    SOAP response message. With simple responses (e. g. array of strings) it
    worked.
    I created the PDF as an Interactive form with Livecycle Designer 8.2.
    The Javascript looks like this:
    var cURL = "http://blabla";
    var cTestString = "too";
    SOAP.wireDump=true;
    var response = SOAP.request(
         cURL: cURL,
         oRequest: {
              "http://blabla.com/:complete" : {
              arg0: cTestString
              cAction: "http://bla.com:50000/"
    var resp = response["http://blabla.com:serviceResponse"];
    console.println("lenght:"+resp.length);
    var myns = "http://blabla.com/namespace";
    for (var nItem in resp.return)
      console.println("" + nItem + " " + resp.return[nItem] );
         for (var ConceptView in resp.return[nItem])
           console.println("  "+resp.return[nItem].length);
           console.println("  "+ConceptView+" "+resp.return[nItem][ConceptView] );
           if (ConceptView == myns + ":Response")
              for (var item2 in resp.return[nItem][ConceptView]){
                  console.println("    "+item2+" "+resp.return[nItem][ConceptView][item2] );
    I call the service and when I realized that I do not find out the type of the object returned, I used the nested for-in-loops to iterate through it. But it seems that there is just one item in the Javascript object returned, although the SOAP message clearly shows that there are more than one item.
    Can you help me?
    One key problem when analyzing this issue is that I do not know at all
    the Javascript type of response. We suspected it might be an array, but it is not
    because the method .length returns "undefined". It would already be
    helpful to know at least the type of this object and to know callable
    methods and so on ...
    Best regards
    Christoph
    P.S. As mentioned I used Livecycle Designer 8.2 and displayed and
    debugged the document using Acrobat 9.

    Christoph,
    Firstly LiveCycle Designer 8.2 is still not supported to develop forms as per my knowledge. The latest version compatible for SAP Interactive Forms is ALD 8.0.
    There is a difference between Acrobat based forms and LiveCycle forms and based on your coding it looks to me  that you are trying to create a LiveCycle based form with coding of Acrobat which is not supported in LiveCycle Desginer, which is why you may be getting the error.
    I hope that does not confuse you, so may check this [link|http://www.acrobatusers.com/articles/2006/08/designer_or_forms/index.php] for some clear information on what point I was trying to make.
    Chintan

  • How to deal with the mouse events when the thread is running

    Hi everybody,
    I have a problem with my program.
    Now I want to present a picture for some time in the Canvas,then automatically clear the screen, but when the user press the mousebutton or keybutton, I want to stop the thread and clear the screen.
    How can I receive the mouse event when the thread is running?
    Thanks,

    I use my code in a GUI applet.
    I try to use the code tag, it's the first time.
                   Image im=sd.getStimulus(obj);
                   if(pos==null){
                        g.drawImage(im, (w-im.getWidth(null))/2,(h-im.getHeight(null))/2,null);
                   }else{
                        g.drawImage(im, pos.x,pos.y,pos.w,pos.h,null);
                   try{
                        sleep(showtime);
    //                    Thread.sleep(showtime);
                   }catch(InterruptedException e){}
                   if(pos==null){
                        g.clearRect((w-im.getWidth(null))/2,(h-im.getHeight(null))/2,im.getWidth(null),im.getHeight(null));
                   }else{
                        g.clearRect(pos.x,pos.y, pos.w, pos.h);
                   }

  • How can we handle browser settings while dealing with the security ?

    Hi ,
    how can we handle browser settings while dealing with the security ?When we configured security in web.xml , during the first request the container is asking for the authentication credentials once they are provided it go's on. but when the user gives a fresh request from the second window within the same browser that time it is not asking for authentication. How can we overcome this.Is there anything to do with server configurations?
    How can we make the container no to keep the things or act like session?

    Ya... I am taking a small example need not happen always but a kind of possibility i am thinking off.
    once the user sign out and just left without closing the browser and a friend (suppose not a good friend ... just kidding...) of that user may open the same jsp or file .This time the security is breached. If that feature or property exists....
    I know what you might say ... the user will log-out before leaving where a programer might invalidate the session at the time of log out.
    Consider the case of a bad Programing or just a programer might forget to invalidate,At that time as a application administrator how can he solve that issue.
    Thanks.......
    Edited by: user8483670 on Jun 6, 2011 1:08 AM
    Edited by: user8483670 on Jun 6, 2011 1:09 AM

  • How to deal with the situation when the database change into ms-sqlserver ?

    Hi,dear all,
    How to deal with the situation when the database change into ms-sqlserver or other database?
    Now, i want to build a j2ee project with ORACLE ADF bc,but this project may be used in several diffrent databases for example oracle db,ms db,mysql and so on.however,if i have developer this project in jdeveloper and this project connection was config as a oracle database,and then,can this project be reused for other databases espasially including the model codes? if yes,how should i do?
    all who know how to resolve this,tell me pls,thanks.
    bruce Li,
    China
    Message was edited by:
    user526724

    Hi Paulbin,
    Do you want to supply a function-pointer to a DLL so it can call[back] your VI?  Here's how it can be done with .NET, though, that solution requires a C compiler.   A single "VI_to_function-reference" utility could handle all cases where the callback passes no parameters.  Maybe someday somebody will share that dll.
    Did you know that LabVIEW can use Events for some COM-signals change?  See pic.  (Note: DTR is not listed - - )
    Another question is another function's prototype is WORD SetTestType(WORD comHandle, bool type1, bool type2, bool type3),   I tried to use a boolean control and a Boolean to (0,1) node in labVIEW to pass parameters to CLF, I config the bool input value as U8(according to C++ bool type) and U32(according to WIN32 BOOL type), it dose not help, when I execute the VI, LabVIEW will be disappeare, it seems to be closed, I must start it again.
    Could someone has similar experience on this points?
    It's easy to crash LabVIEW misusing CLF - maybe there's another reason for the crash besides bool mis-match(?)  Do you know which "Calling convention" is required?  What type is comHandle? (where does comHandle come from?) 
    Cheers!
    Message Edited by tbd on 03-23-2007 09:34 PM
    Message Edited by tbd on 03-23-2007 09:35 PM
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
    Attachments:
    evt.jpg ‏7 KB

  • My brand new Macbook PRO crashed completely after it went through the iOS 10.7.4 update, I lost everything and Apple just wants to replace the HD and let me deal with the hassle.

    Last Thursday May 10th I received a prompt from the Automatic Update to update the iOS to Ver. 10.7.4, set the start and was watching the progress when it stopped with an error message saying that it was not able to update, right below there was a buttom "RESTART", pressed the buttom and waited to re-boot.....That was the end of my computer, somehow the update crashed my HD beyond recover, it would only show the gray screen with Apple logo in the center and kept beeping, BEEP BEEP BEEP.....PAUSE.....BEEP BEEP BEEP.....PAUSE.....on and on and on and it never past that.
    Friday May 11 I took it to a retailer where I received the bad news that the HD was crashed and the teck couldn't even try to copy anything from it as it couldn't locate it. I checked iCloud on a hope that all my stuff would be there but new surprise, iCloud didn't kept all of my stuff as it was programmed to.
    Now here is the funny part, the tech from the retailer informed me that the only thing they could do was to order a new HD for my 4 months old Macbook and that the time to have my computer back will be at least 15 days, now that is the funny part, I fail to understand why do I have to suffer the hassle of loosing all my data plus wait at least 15th days to have my computer back (meanwhile loose work) on a problem caused by Apple, PROBLEM, not machine defect, clearly my computer had no problem untill I followed the procedure to update.
    On Saturday May 12 I contacted Local Apple Support (I have failed to mention that I live in Brasil) and they informed me that what the dealer said was the only thing that could be done, too bad for me if I lost everything, going to loose several days of work and whenever I receive my computer back will have to re-construct all my life and deal with the forever lost data.....DEAL WITH IT
    After a couple of discussion with Apple Support and the Dealer, I made my decision to take the Macbook to the dealer today for repair and meanwhile I'm opening a case with the Brazilian Justice to have Apple honor with all the trouble and hassle that it is causing me, it's said that I have to take this type of action as I'm a very fan of Apple and it's products, have had several iPods, iPhones, Macbooks, Keyboards, Mouses, Apple TV, etc.....This i the first time I have a problem with a Apple product and got a taste of the "Apple Care", it seems like Apple is more concerned on seeling products then keeping long time customers happy.
    One last thing, today when I was at the dealer to drop my computer for repair, the Technician informed me that he also had a computer crashed and the HD erase on Sunday May 13th in the same way of mine, after the update everything was gone, also he said that we were not the only ones, iPads and iPhones were going trough the same situation, update causing complete breakdown.
    WORD OF ADVISE, BE 1000% SURE THAT YOU HAVE EVRYTHING BACKED UP BEFORE YOU GO THROUGH AN UPDATE.

    rvalezin wrote:
    If I need to back-up every hour of my life in order to be able to save everything from something like this I won´t do anything else.....at least we should be able to trust that Apple tests this updates so situations like this won´t happen.
    That's exactly what Time Machine does for you.  It backs up every hour, so you don't have to.  While it is backing up, you keep on working.  Time Macvhine came with your Mac and you chose not to use it.
    The 10.7.4 update did not cause your hard disk to fail.  Hard disk fail due to mechanical causes.  They are extremely reliable, but that doesn't mean every hard disk will last a long time.  Your mileage WILL vary!
    If you are dependent on your computer and the data stored on it, then you should make sure you have AT LEAST two copies of all data and probably three or four.  You should use at least two means of backing up in case the backup software has a problem.  And you should consider having a backup computer if you live in an area where replacement takes too long (whatever too long is for your business).
    Apple hardware and software is very, very good.  You have documented your experience of this.  But NO hardware or software is perfect.  You also have experience of this.
    It is YOUR responsibility to ensure that your system is set up to protect your data and availability of computing resources.

  • Problems with SKIP FIRST Screen when calling a transaction variant

    Hi,
    I have a transaction variant of VA02 that suppresses the display of the pricing button on the conditions screen. I have created a variant transaction for called ZA02 which calls this variant of VA02.
    In my program I have coded the following :-
          SET PARAMETER ID 'AUN' FIELD  VBELN.
          SET PARAMETER ID 'VPO' FIELD  POSNR.
          CALL TRANSACTION 'ZA02' AND SKIP FIRST SCREEN.
    I would have expected the program to display the second screen of VA02 but it displays the first screen and when I hit return key the second screen is then displayed.
    I don't think I need VPO setting but when I code
          SET PARAMETER ID 'AUN' FIELD  VBELN.
          SET PARAMETER ID 'VPO' FIELD  POSNR.
          CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
    VA02's second screen is displayed
    Any help as to how to Skip this first screen with ZA02 would be greatly appreciated
    Thanks
    Rous

    Yes you are right Reg thanks for that.
    But it appears that VA02 doesn't require it setting anyway. I changed the PID to APO and indeed I've even commented the line out, but my program goes to the second screen when calling VA02 but stays on the first screen when calling ZA02 .

  • What's the deal with the CC menubar panel?

    What's the deal with the CC menubar panel? The tab to the apps are gone -- looks like it wants me to update the panel itself rather than list my installed apps. I've been on CC for about a month, is this common? Thankfully I can still open all apps normally, but the internet seems to think the "CC Way" is a horror show.
    Do you guys have trouble after updating the updater? All this talk of running "the cleaner" (a mafia term?) and reinstalling everything with each version bump is kinda scary. It could be that people only post online when things go wrong, and 95% of people update just fine. But since I'm new I guess I'd want some reassurance before committing to a night of Cleaning and Reinstalling...
    I'm one of those people who think app updates very 12 to 18 months was just fine (and stable). Would it be harmful to ignore updates for a few months? Lets see, I have a healing brush, smart objects, a blob tool, pretty good 3D in AE, ID seems to handle type pretty well… there's really no reason to update every month is there?
    -- Jim

    Has anyone had a normal non-cleaning install of this week's update?

  • How do i deal with multiple iPhoto libraries when migrating to Photos

    how do i deal with multiple iPhoto libraries when migrating to Photos

    I would merge them before the migration.  Also, spend some time doing any batch changes of names and dates beforehand too.
    iPhoto Library Manager has good merge and duplicate search facilities.
    http://www.fatcatsoftware.com/iplm/

  • ITunes randomly stops playing purchases that have previously viewed on the same hardware. It has an error message about HD. How can this issue be resolved?  What information is available besides the "learn more" option that does not deal with the problem?

    iTunes randomly stops playing purchases that have previously viewed on the same hardware. It has an error message about HD. How can this issue be resolved?  What information is available besides the "learn more" option that does not deal with the problem?
    Many people have the same problem. However, there is little or nothing readily available to users. This problem has existed for two or more years. Does anyone have anything to offer about this disturbing problem?

    Thanks for the suggestion kcell. I've tried both versions
    9.0.115 and 9.0.124 and both fail with the policy permission error.
    I also tried with and without your crossdomain.xml file but
    with the same result. It looks like this file is intended for URL
    policy, instead of socket policy. Recently Adobe separated the two.
    When I run with the files installed on my dev PC, it does
    work, which makes sense because the flash player isn't loaded from
    an unknown domain.
    I did get one step closer. If a crossdomain.xml in the server
    root exists and the socketpolicy file is loaded from the app folder
    then the first two warnings disappear. The logs now show:
    OK: Root-level SWF loaded:
    https://192.168.2.5/trunk/myapp.swf
    OK: Policy file accepted: https://192.168.2.5/crossdomain.xml
    OK: Policy file accepted:
    https://192.168.2.5/trunk/socketpolicy.xml
    Warning: Timeout on xmlsocket://192.168.2.5:843 (at 3
    seconds) while waiting for socket policy file. This should not
    cause any problems, but see
    http://www.adobe.com/go/strict_policy_files
    for an explanation.
    Warning: [strict] Ignoring policy file with incorrect syntax:
    xmlsocket://192.168.2.5:993
    Error: Request for resource at xmlsocket://192.168.2.5:993 by
    requestor from https://192.168.2.5/trunk/myapp.swf is denied due to
    lack of policy file permissions.
    Which basically says, everything is okay, but you stay out
    anyway.
    PS: I found the XML schema files here:
    http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_02.html
    and the socket policy schema:
    http://www.adobe.com/xml/schemas/PolicyFileSocket.xsd.
    UPDATE: When serving up the policy file on port 843 using the
    example perl script then the socket connection seems to be accepted
    and the connect succeeds. After that flex hangs trying to logon to
    the IMAP server.

  • Am using Safari 4.1.3 with system 10.4.11 and can only come up with advances preference page when calling up security - thus cannot see cookies. I have Safari 5.0.6 on my MacBook. Will it run on my older machine? Can I transfer older bookmarks?

    Am using Safari 4.1.3 with system 10.4.11 and can only come up with advances preference page when calling up security - thus cannot see cookies. I have Safari 5.0.6 on my MacBook. Will it run on my older machine? Can I transfer older bookmarks to the new software?
    Machine Serial Number:          W8*********AR
    <Personal Information Edited by Host>

    Safari preferences has no...

  • I updated my iphone to iOS 6.0.1but it doesn't show the contacts names when calling or receiving calls. What to do?

    I updated my iphone to iOS 6.0.1but it doesn't show the contacts names when calling or receiving calls. What to do?

    This may be an error caused by the update. You can try to sync your contact information with iCloud and backup the rest of your data and then restore the device and see if it starts to work normally again.

  • Proactively dealing with the heat.

    Many user's of the new macbook's and macbook pro's are recognizing the high heat issues of these machines. Some however report of having no significant heat experience at all. I do not see any reason why some macbook's who get uncomfortably hot and some wouldn't. Is it possible that some user's w/o complaints simply haven't used thier computer for long enough periods to establish a significant heat level? Most people don't even use a computer for longer than an hour or so,. Personally, my macbook gets a little warm. But this is only after an hour or so. During the first hour, following a long rest/sleep, the heat is fine. After that I must say that it gets a little warm on my lap, enough for me to shift it around every once and a while. But it really doesn't bother me that much. But the key word here. "ME."
    I venture to say this:
    All macbook's and macbook pro's and quite possibly all notebook's will get hot to uncomfortable point if used for a long enough period. However, since the description "uncomfortable" is entirely subjective, we will get:
    1. More extreme reports from user's with very sensitive skin.
    2. Mild or no report at all from user's not sensitive enough for the warmth to get to them.
    3. Report's of no heat problems whatsoever from user's who do not use thier computer's for long enough periods, or long enough sitting's to warrant the upper heat levels (by far, the vast majority of user's will be in this category and you will never hear a word from them. If you do, it will be very positive, which is entirely O.K. and honest and absolutely understandable, albeit perhaps a bit misleading to a different user.)
    4. Report's of no heat from user's who, in the much understandable excitement of having just recieved the macbook, have prematurely posted a no heat experience without even having used thier machine long enough.
    Personally, I fall under the #2 group. If the heat begin's to bother me I just shift the computer a little bit or put it on the table instead. I, out of what I would call common sense, never expected that a notebook would not be hot.
    Notebook's are going to get hot. Cram all that power into such a small area and heat will certainly be produced. Now one can argue for the reasons why but one can also not escape the fact that pretty much all laptop and notebook computer's get very warm after extended use periods or processor heavy periods. With the current technology there is not a way to remove this issue.
    All this being said, we must discover ways of minimizing that heat if we should want to use our notebooks indeed as "laptops." I am open to dealing with the heat issue and am open to any advice any of you can offer to minimize this inherent issue. Those of us who are bothered by the heat level and have found or know of ways of reducing it should speak. Does anyone care to start?
    (DO NOT POST TO TELL ME THAT YOU HAVE NO HEAT PROBLEMS. THE HEAT PROBLEMS ARE NOT BAD. THEY ARE JUST THERE. WETHER OR NOT YOU DEFINE IT AS A PROBLEM DEPENDS ENTIRE UPON YOU AND YOUR PERSONAL EXPERIECE. I WANT ONLY TO DEAL WITH THEM HERE.)

    A simple visit to an Apple store (if geographically possible) will show that your model, the 1.83ghz MacBook, appears to be the coolest to the touch along the bottom and topsides, of all models. Oddly, in one of the stores we visited (of 3), the temperature varied among the same configurations. ie. Black MacBooks along side one another, where one was much, much warmer than the other, confirmed by store members and personnel. A 17" MacBook Pro was the coolest to the touch, but possibly because the larger surface area of the shell made for a greater radiator or heat sink, if you will.
    We have 2 MacBooks, an iMacIntel Duo 20", and a venerable 17" G4 Powerbook. The heat generated varies remarkably on the Intel processors depending on configuration of memory, usage, climate and the programs running.
    Now if the Macbooks only had a backlit keyboard, then it would be nearly perfect for those night time living room surfing in the dark evenings at our house.
    Black MacBook (2), iMac Duo 20", Powerbook 17" etc Mac OS X (10.4.6) Stock configuration

Maybe you are looking for