- Timestamp:
- Apr 27, 2022 8:27:17 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/UpdateAgentImpl.cpp
r94713 r94716 723 723 724 724 /** 725 * Reports an error by setting the error info and also inform ationsubscribed listeners.725 * Reports an error by setting the error info and also informs subscribed listeners. 726 726 * 727 727 * @returns HRESULT … … 732 732 HRESULT UpdateAgent::i_reportError(int vrc, const char *pcszMsgFmt, ...) 733 733 { 734 AssertReturn(pcszMsgFmt && *pcszMsgFmt != '\0', E_INVALIDARG); 735 734 736 va_list va; 735 737 va_start(va, pcszMsgFmt); 736 738 737 char *psz = NULL; 738 if (RTStrAPrintfV(&psz, pcszMsgFmt, va) <= 0) 739 return E_OUTOFMEMORY; 740 741 LogRel(("Update agent (%s): %s\n", mData.m_strName.c_str(), psz)); 742 743 ::FireUpdateAgentErrorEvent(m_EventSource, psz, vrc); 744 745 HRESULT const rc = setErrorVrc(VERR_COM_IPRT_ERROR /** @todo Translate HTTP errors to COM? */, psz); 739 Utf8Str strMsg; 740 HRESULT const rc = strMsg.printfVNoThrow(pcszMsgFmt, va); 741 if (FAILED(rc)) 742 { 743 va_end(va); 744 return rc; 745 } 746 746 747 747 va_end(va); 748 RTStrFree(psz); 749 750 return rc; 748 749 LogRel(("Update agent (%s): %s\n", mData.m_strName.c_str(), strMsg.c_str())); 750 751 ::FireUpdateAgentErrorEvent(m_EventSource, strMsg.c_str(), vrc); 752 753 return setErrorBoth(VERR_COM_IPRT_ERROR, vrc, strMsg.c_str()); 751 754 } 752 755
Note:
See TracChangeset
for help on using the changeset viewer.