Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor AbstractLicenseValidator messages #19

Open
corbob opened this issue May 13, 2022 · 0 comments
Open

Refactor AbstractLicenseValidator messages #19

corbob opened this issue May 13, 2022 · 0 comments

Comments

@corbob
Copy link
Member

corbob commented May 13, 2022

Is Your Feature Request Related To A Problem? Please describe.

The AbstractLicenseValidator.cs file contains a number of messages that are similar. Additionally there are some places where we're using the wrong variable (licenseType instead of License).

Describe The Solution. Why is it needed?

These should likely be abstracted into a constant variable for the message with formatting to insert the actual issue.

Additional Context.

Some examples:

if (date == null)
{
    Log.WarnFormat("[Licensing] Could not find expiration in license:\r\n{0}", License);
    return false;
}

// snip

if (licenseType == null)
{
    Log.WarnFormat("[Licensing] Could not find license type in {0}", licenseType);
    return false;
}

In this section, the message could be a refactored something like:

const string WARNING_MESSAGE = "[Licensing] Could not find {0} in license\r\n{1}";

// snip

if (date == null)
{
    Log.WarnFormat(WARNING_MESSAGE, "expiration", License);
    return false;
}

// snip

if (licenseType == null)
{
    Log.WarnFormat(WARNING_MESSAGE, "license type", License); // Note that licenseType was changed here as it's not actually what was intended.
    return false;
}

Related Issues

Discovered some of this while working on 18, but not related to 18 in any other way.

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

No branches or pull requests

1 participant