VirtualBox

Changeset 74395 in vbox


Ignore:
Timestamp:
Sep 20, 2018 9:52:13 PM (6 years ago)
Author:
vboxsync
Message:

IPRT/rest: Implemented support for polymorphic parameters (requests). bugref:9167

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/err.h

    r74378 r74395  
    32543254/** Unable to parse string as bool. */
    32553255#define VERR_REST_UNABLE_TO_PARSE_STRING_AS_BOOL        (-25710)
     3256/** A path parameter was not set. */
     3257#define VERR_REST_PATH_PARAMETER_NOT_SET                (-25711)
     3258/** A required query parameter was not set. */
     3259#define VERR_REST_REQUIRED_QUERY_PARAMETER_NOT_SET      (-25712)
     3260/** A required header parmaeter was not set. */
     3261#define VERR_REST_REQUIRED_HEADER_PARAMETER_NOT_SET     (-25713)
    32563262
    32573263/** Internal error \#1. */
  • trunk/src/VBox/Runtime/common/rest/RTCRestClientRequestBase.cpp

    r74117 r74395  
    100100                     != RTCRestObjectBase::kCollectionFormat_multi,
    101101                     VERR_INTERNAL_ERROR_3);
    102         AssertMsg(m_fIsSet & RT_BIT_64(a_paPathParams[i].iBitNo),
    103                   ("Path parameter '%s' is not set!\n", a_paPathParams[i].pszName));
     102        AssertMsgReturn(a_paPathParamStates[i].pObj != NULL,
     103                        ("Path parameter '%s' is not set!\n", a_paPathParams[i].pszName),
     104                        VERR_REST_PATH_PARAMETER_NOT_SET);
     105        AssertMsgReturn(m_fIsSet & RT_BIT_64(a_paPathParams[i].iBitNo),
     106                        ("Path parameter '%s' is not set!\n", a_paPathParams[i].pszName),
     107                        VERR_REST_PATH_PARAMETER_NOT_SET);
    104108
    105109        rc = a_paPathParamStates[i].pObj->toString(&strTmpVal, a_paPathParams[i].fFlags);
     
    132136            || (m_fIsSet & RT_BIT_64(a_paQueryParams[i].iBitNo)) )
    133137        {
    134             AssertMsg(m_fIsSet & RT_BIT_64(a_paQueryParams[i].iBitNo),
    135                       ("Required query parameter '%s' is not set!\n", a_paQueryParams[i].pszName));
     138            AssertMsgReturn(a_papQueryParamObjs[i] != NULL,
     139                            ("Required query parameter '%s' is not set!\n", a_paQueryParams[i].pszName),
     140                            VERR_REST_REQUIRED_QUERY_PARAMETER_NOT_SET);
     141            AssertMsgReturn(m_fIsSet & RT_BIT_64(a_paQueryParams[i].iBitNo),
     142                            ("Required query parameter '%s' is not set!\n", a_paQueryParams[i].pszName),
     143                            VERR_REST_REQUIRED_QUERY_PARAMETER_NOT_SET);
    136144
    137145            if (   (a_paQueryParams[i].fFlags & RTCRestObjectBase::kCollectionFormat_Mask)
     
    185193            || (m_fIsSet & RT_BIT_64(a_paHeaderParams[i].iBitNo)) )
    186194        {
    187             AssertMsg(m_fIsSet & RT_BIT_64(a_paHeaderParams[i].iBitNo),
    188                       ("Required header parameter '%s' is not set!\n", a_paHeaderParams[i].pszName));
     195            AssertMsgReturn(m_fIsSet & RT_BIT_64(a_paHeaderParams[i].iBitNo),
     196                            ("Required header parameter '%s' is not set!\n", a_paHeaderParams[i].pszName),
     197                            VERR_REST_REQUIRED_HEADER_PARAMETER_NOT_SET);
     198            AssertMsgReturn(a_papHeaderParamObjs[i] != NULL,
     199                            ("Required header parameter '%s' is not set!\n", a_paHeaderParams[i].pszName),
     200                            VERR_REST_REQUIRED_HEADER_PARAMETER_NOT_SET);
    189201
    190202            if (!a_paHeaderParams[i].fMapCollection)
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