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

Add error message parsing to Google API call #7

Open
StevenWeathers opened this issue Dec 8, 2018 · 0 comments
Open

Add error message parsing to Google API call #7

StevenWeathers opened this issue Dec 8, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@StevenWeathers
Copy link
Owner

Add error message parsing to Google API Call to better log what happened

if ($Result -like "good*") {
            $splitResult = $Result.split(" ")
            $newIp = $splitResult[1]
            Write-Verbose "IP successfully updated for $subAndDomain to $newIp."
        }
        if ($Result -like "nochg*") {
            $splitResult = $Result.split(" ")
            $newIp = $splitResult[1]
            Write-Verbose "No change to IP for $subAndDomain (already set to $newIp)."
        }
        if ($Result -eq "badauth") {
            Throw "The username/password you providede was not valid for the specified host."
        }
        if ($Result -eq "nohost") {
            Throw "The hostname you provided does not exist, or dynamic DNS is not enabled."
        }
        if ($Result -eq "notfqdn") {
            Throw "The supplied hostname is not a valid fully-qualified domain name."
        }
        if ($Result -eq "badagent") {
            Throw "You are making bad agent requests, or are making a request with IPV6 address (not supported)."
        }
        if ($Result -eq "abuse") {
            Throw "Dynamic DNS access for the hostname has been blocked due to failure to interperet previous responses correctly."
        }
        if ($Result -eq "911") {
            Throw "An error happened on Google's end; wait 5 minutes and try again."
        }
@StevenWeathers StevenWeathers added the enhancement New feature or request label Dec 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant