VirtualBox

Ignore:
Timestamp:
May 8, 2008 1:43:21 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
30647
Message:

Added a setErrorNoLog method and aLogIt argument to the core setError methods (defaults to true) so that we can get rid of the disturbing release log errors caused by the USB drop down menu in the GUI.

File:
1 edited

Legend:

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

    r8688 r8709  
    11051105    static HRESULT setErrorInternal (HRESULT aResultCode, const GUID &aIID,
    11061106                                     const Bstr &aComponent, const Bstr &aText,
    1107                                      bool aWarning);
     1107                                     bool aWarning, bool aLogIt);
    11081108
    11091109protected:
     
    12331233
    12341234    static HRESULT setError (HRESULT aResultCode, const GUID &aIID,
    1235                                     const Bstr &aComponent,
    1236                                     const Bstr &aText)
     1235                             const Bstr &aComponent,
     1236                             const Bstr &aText,
     1237                             bool aLogIt = true)
    12371238    {
    12381239        return setErrorInternal (aResultCode, aIID, aComponent, aText,
    1239                                  false /* aWarning */);
     1240                                 false /* aWarning */, aLogIt);
    12401241    }
    12411242
     
    12451246    {
    12461247        return setErrorInternal (aResultCode, aIID, aComponent, aText,
    1247                                  true /* aWarning */);
     1248                                 true /* aWarning */, true /* aLogIt */);
    12481249    }
    12491250
    12501251    static HRESULT setError (HRESULT aResultCode, const GUID &aIID,
    12511252                             const Bstr &aComponent,
    1252                              const char *aText, va_list aArgs)
     1253                             const char *aText, va_list aArgs, bool aLogIt = true)
    12531254    {
    12541255        return setErrorInternal (aResultCode, aIID, aComponent,
    12551256                                 Utf8StrFmtVA (aText, aArgs),
    1256                                  false /* aWarning */);
     1257                                 false /* aWarning */, aLogIt);
    12571258    }
    12581259
     
    12631264        return setErrorInternal (aResultCode, aIID, aComponent,
    12641265                                 Utf8StrFmtVA (aText, aArgs),
    1265                                  true /* aWarning */);
     1266                                 true /* aWarning */, true /* aLogIt */);
    12661267    }
    12671268};
     
    13821383        va_start (args, aText);
    13831384        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError
    1384             (aResultCode, aIID, aComponent, aText, args);
     1385            (aResultCode, aIID, aComponent, aText, args, true /* aLogIt */);
    13851386        va_end (args);
    13861387        return rc;
     
    14361437        va_start (args, aText);
    14371438        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError
    1438             (aResultCode, COM_IIDOF(I), C::getComponentName(), aText, args);
     1439            (aResultCode, COM_IIDOF(I), C::getComponentName(), aText, args, true /* aLogIt */);
    14391440        va_end (args);
    14401441        return rc;
     
    14731474    {
    14741475        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError
    1475             (aResultCode, COM_IIDOF(I), C::getComponentName(), aText, aArgs);
     1476            (aResultCode, COM_IIDOF(I), C::getComponentName(), aText, aArgs, true /* aLogIt */);
    14761477        return rc;
    14771478    }
     
    15091510    {
    15101511        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError
    1511             (aResultCode, COM_IIDOF(I), C::getComponentName(), aText);
     1512            (aResultCode, COM_IIDOF(I), C::getComponentName(), aText, true /* aLogIt */);
    15121513        return rc;
    15131514    }
     
    15441545        va_start (args, aText);
    15451546        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError
    1546             (aResultCode, aIID, C::getComponentName(), aText, args);
     1547            (aResultCode, aIID, C::getComponentName(), aText, args, true /* aLogIt */);
    15471548        va_end (args);
    15481549        return rc;
     
    15651566        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning
    15661567            (aResultCode, aIID, C::getComponentName(), aText, args);
     1568        va_end (args);
     1569        return rc;
     1570    }
     1571
     1572    /**
     1573     *  Sets the error information for the current thread but doesn't put
     1574     *  anything in the release log. This is very useful for avoiding
     1575     *  harmless error from causing confusion.
     1576     *
     1577     *  It is otherwise identical to #setError (HRESULT, const char *text, ...).
     1578     */
     1579    static HRESULT setErrorNoLog (HRESULT aResultCode, const char *aText, ...)
     1580    {
     1581        va_list args;
     1582        va_start (args, aText);
     1583        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError
     1584            (aResultCode, COM_IIDOF(I), C::getComponentName(), aText, args, false /* aLogIt */);
    15671585        va_end (args);
    15681586        return rc;
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