diff --git a/src/AppInstallerCommonCore/HttpClientHelper.cpp b/src/AppInstallerCommonCore/HttpClientHelper.cpp index df22d6664a..c02a6822a2 100644 --- a/src/AppInstallerCommonCore/HttpClientHelper.cpp +++ b/src/AppInstallerCommonCore/HttpClientHelper.cpp @@ -242,7 +242,7 @@ namespace AppInstaller::Http return response.extract_json().get(); } - [[noreturn]] void HttpClientHelper::RethrowAsWilException(web::http::http_exception& exception) + [[noreturn]] void HttpClientHelper::RethrowAsWilException(const web::http::http_exception& exception) { THROW_WIN32_MSG(exception.error_code().value(), "%hs", exception.what()); } diff --git a/src/AppInstallerCommonCore/Public/winget/HttpClientHelper.h b/src/AppInstallerCommonCore/Public/winget/HttpClientHelper.h index ffef125a59..9841a4afdd 100644 --- a/src/AppInstallerCommonCore/Public/winget/HttpClientHelper.h +++ b/src/AppInstallerCommonCore/Public/winget/HttpClientHelper.h @@ -45,7 +45,7 @@ namespace AppInstaller::Http web::http::client::http_client GetClient(const utility::string_t& uri) const; // Translates a cpprestsdk http_exception to a WIL exception. - static void RethrowAsWilException(web::http::http_exception& exception); + static void RethrowAsWilException(const web::http::http_exception& exception); std::shared_ptr m_defaultRequestHandlerStage; web::http::client::http_client_config m_clientConfig;