Skip to content

Conversation

@deschuma
Copy link
Collaborator

@deschuma deschuma commented Jun 4, 2020

This PR fixes a crash which would occur if neither the logging callback nor the azure dcap specific environment variable is set and adds a test for this condition

This was tested against Windows Server 2016 and Ubuntu 16

static std::string get_env_variable(std::string env_variable)
#include <sstream>

static std::string get_env_variabe_no_log(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of taking an "out" parameter and returning a string value, would it make sense to return a std::pair (or std::tuple) with two string values - an error and an environment value? That way the calling signature is the same and you can change the error handling pattern to be auto val = get_env_variable_no_log(xxx); if (!val.second.empty()) { log val.second; }?

static std::string get_env_variable(std::string env_variable)
#include <sstream>

static std::string get_env_variabe_no_log(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_env_variabe_no_log??? Spelling error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! fixed

@deschuma deschuma requested a review from LarryOsterman June 4, 2020 21:03
@deschuma deschuma merged commit 6b2be92 into master Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants