mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix error when listing MIAA databases (#14286)
This commit is contained in:
@@ -198,12 +198,16 @@ export function getErrorMessage(error: any, useMessageWithLink: boolean = false)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses an address into its separate ip and port values. Address must be in the form <ip>:<port>
|
* Parses an address into its separate ip and port values. Address must be in the form <ip>:<port>
|
||||||
|
* or <ip>,<port>
|
||||||
* @param address The address to parse
|
* @param address The address to parse
|
||||||
*/
|
*/
|
||||||
export function parseIpAndPort(address: string): { ip: string, port: string } {
|
export function parseIpAndPort(address: string): { ip: string, port: string } {
|
||||||
const sections = address.split(':');
|
let sections = address.split(':');
|
||||||
if (sections.length !== 2) {
|
if (sections.length !== 2) {
|
||||||
throw new Error(`Invalid address format for ${address}. Address must be in the form <ip>:<port>`);
|
sections = address.split(',');
|
||||||
|
if (sections.length !== 2) {
|
||||||
|
throw new Error(`Invalid address format for ${address}. Address must be in the form <ip>:<port> or <ip>,<port>`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
ip: sections[0],
|
ip: sections[0],
|
||||||
|
|||||||
Reference in New Issue
Block a user