VirtualBox

Changeset 97460 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Nov 8, 2022 4:52:06 PM (2 years ago)
Author:
vboxsync
Message:

Guest Control/Main: Made it easier to spot bugs with unfinished (i.e. not correctly notified) tasks. Tell the user to report those if found.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestSessionImplTasks.h

    r97446 r97460  
    185185    {
    186186        int vrc = Run();
    187         if (RT_FAILURE(vrc))
     187        if (RT_FAILURE(vrc)) /* Could be VERR_INTERRUPTED if the user manually canceled the task. */
    188188        {
    189             /* Make sure to let users know if there is a buggy task which failed but didn't set the progress object to a failed state. */
    190             BOOL fCompleted;
    191             if (SUCCEEDED(mProgress->COMGETTER(Completed(&fCompleted))))
     189            /* Make sure to let users know if there is a buggy task which failed but didn't set the progress object
     190             * to a failed state, and if not canceled manually by the user. */
     191            BOOL fCanceled;
     192            if (SUCCEEDED(mProgress->COMGETTER(Canceled(&fCanceled))))
    192193            {
    193                 AssertReleaseMsg(fCompleted,
    194                                  ("Guest Control: Task '%s' failed with %Rrc, but progress is not completed yet. Please report this bug!\n",
    195                                   mDesc.c_str(), vrc));
     194                if (!fCanceled)
     195                {
     196                    BOOL fCompleted;
     197                    if (SUCCEEDED(mProgress->COMGETTER(Completed(&fCompleted))))
     198                    {
     199                        if (!fCompleted)
     200                            setProgressErrorMsg(E_UNEXPECTED,
     201                                                Utf8StrFmt(tr("Task '%s' failed with %Rrc, but progress is still pending. Please report this bug!\n"),
     202                                                           mDesc.c_str(), vrc));
     203                    }
     204                    else
     205                        AssertReleaseMsgFailed(("Guest Control: Unable to retrieve progress completion status for task '%s' (task result is %Rrc)\n",
     206                                                mDesc.c_str(), vrc));
     207                }
    196208            }
    197209            else
    198                 AssertReleaseMsgFailed(("Guest Control: Unable to retrieve progress completion status for task '%s' (task result is %Rrc)\n",
     210                AssertReleaseMsgFailed(("Guest Control: Unable to retrieve progress cancellation status for task '%s' (task result is %Rrc)\n",
    199211                                        mDesc.c_str(), vrc));
    200212        }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette