* Parse an error message to see if it contains an IP address. * Returns the IP address if found, otherwise undefined.
(errorMessage: string)
| 90 | * Returns the IP address if found, otherwise undefined. |
| 91 | */ |
| 92 | private static parseErrorForIpAddress(errorMessage: string): string | undefined { |
| 93 | let ipAddress: string | undefined; |
| 94 | const ipAddresses = errorMessage.match(Constants.ipv4MatchPattern); |
| 95 | if (!!ipAddresses) { |
| 96 | ipAddress = ipAddresses[0]; |
| 97 | } |
| 98 | return ipAddress; |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * Builds the beginning of a sqlcmd command populated with the connection settings. |