Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Add error message parsing to Google API call #7

Description

@StevenWeathers

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."
        }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions