VirtualBox

Changeset 26236 in vbox


Ignore:
Timestamp:
Feb 4, 2010 2:38:16 PM (15 years ago)
Author:
vboxsync
Message:

Main: remove some dead errorinfo code

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/SupportErrorInfo.h

    r22173 r26236  
    246246     */
    247247    virtual const char *componentName() const = 0;
    248 
    249     /**
    250      * Sets the error information for the current thread.
    251      *
    252      * When the error information is set, it can be retrieved by a caller of an
    253      * interface method using the respective methods that return an IErrorInfo
    254      * object in MS COM (nsIException object in XPCOM) set for the current
    255      * thread. This object can also be or queried for the platform-independent
    256      * IVirtualBoxErrorInfo interface that provides extended error information
    257      * (only for components from the VirtualBox COM library). Alternatively, the
    258      * platform-independent ErrorInfo class can be used to retrieve error info
    259      * in a convenient way.
    260      *
    261      * It is assumed that the interface method that uses this function returns
    262      * an non S_OK result code to the caller (otherwise, there is no reason
    263      * for the caller to check for error info after method invocation).
    264      *
    265      * Here is a table of correspondence between this method's arguments and
    266      * IErrorInfo/nsIException/IVirtualBoxErrorInfo attributes/methods:
    267      *
    268      * <pre>
    269      * argument    IErrorInfo      nsIException    IVirtualBoxErrorInfo
    270      * ----------------------------------------------------------------
    271      * resultCode  --              result          resultCode
    272      * iid         GetGUID         --              interfaceID
    273      * component   GetSource       --              component
    274      * text        GetDescription  message         text
    275      * </pre>
    276      *
    277      * Note that this is a generic method. There are more convenient overloaded
    278      * versions that automatically substitute some arguments taking their
    279      * values from the template parameters. See #setError (HRESULT, const char
    280      * *, ...) for an example.
    281      *
    282      * It is also possible to turn on the multi-error mode so that setting a new
    283      * error information does not destroy the previous error (if any) but makes
    284      * it accessible using the IVirtualBoxErrorInfo::next attribute. See
    285      * MultiResult for more information.
    286      *
    287      * @param  aResultCode  Result (error) code, must not be S_OK.
    288      * @param  aIID         IID of the interface that defines the error.
    289      * @param  aComponent   Name of the component that sets the error (UTF8).
    290      * @param  aText        Error message in UTF8 (must not be NULL).
    291      *
    292      * @return @a aResultCode argument, for convenience. If an error occurs
    293      *         while setting error info itself, that error is returned instead
    294      *         of the @a aResultCode argument.
    295      */
    296     static HRESULT setError(HRESULT aResultCode,
    297                             const GUID &aIID,
    298                             const char *aComponent,
    299                             const char *aText)
    300     {
    301         return setErrorInternal(aResultCode,
    302                                 &aIID,
    303                                 aComponent,
    304                                 aText,
    305                                 false /* aWarning */);
    306     }
    307 
    308     static HRESULT setError(HRESULT aResultCode,
    309                             const GUID &aIID,
    310                             const char *aComponent,
    311                             const Utf8Str &strText)
    312     {
    313         return setErrorInternal(aResultCode,
    314                                 &aIID,
    315                                 aComponent,
    316                                 strText,
    317                                 false /* aWarning */);
    318     }
    319 
    320     /**
    321      * Same as #setError() except that it makes sure that aResultCode doesn't
    322      * have the error severity bit (31) set when passed down to the created
    323      * IVirtualBoxErrorInfo object.
    324      *
    325      * The error severity bit is always cleared by this call, thereof you can
    326      * use ordinary E_XXX result code constants, for convenience. However, this
    327      * behavior may be non-standard on some COM platforms.
    328      */
    329     static HRESULT setWarning(HRESULT aResultCode,
    330                               const GUID &aIID,
    331                               const char *aComponent,
    332                               const char *aText)
    333     {
    334         return setErrorInternal(aResultCode,
    335                                 &aIID,
    336                                 aComponent,
    337                                 aText,
    338                                 true /* aWarning */);
    339     }
    340248
    341249    /**
  • trunk/src/VBox/Main/MediumImpl.cpp

    r26201 r26236  
    10261026        {
    10271027            Assert(!m->strLastAccessError.isEmpty());
    1028             rc = setError(E_FAIL, m->strLastAccessError);
     1028            rc = setError(E_FAIL, m->strLastAccessError.c_str());
    10291029        }
    10301030        else
  • trunk/src/VBox/Main/glue/SupportErrorInfo.cpp

    r26186 r26236  
    340340}
    341341
    342 HRESULT SupportErrorInfoBase::setError(HRESULT aResultCode, const Utf8Str &strText)
    343 {
    344     HRESULT rc = setError(aResultCode,
    345                           mainInterfaceID(),
    346                           componentName(),
    347                           strText);
    348     return rc;
    349 }
    350 
    351342HRESULT SupportErrorInfoBase::setWarning(HRESULT aResultCode, const char *aText, ...)
    352343{
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