File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,11 @@ const gremlin = require('../reverse_engineering/node_modules/gremlin');
55const applyToInstanceHelper = _ => ( {
66 setUpDocumentClient ( connectionInfo ) {
77 const dbNameRegExp = / w s s : \/ \/ ( \S * ) .g r e m l i n \. c o s m o s \. / i;
8- const dbName = dbNameRegExp . exec ( connectionInfo . gremlinEndpoint ) [ 1 ] ;
9- const endpoint = `https://${ dbName } .documents.azure.com:443/` ;
8+ const dbName = dbNameRegExp . exec ( connectionInfo . gremlinEndpoint ) ;
9+ if ( ! dbName || ! dbName [ 1 ] ) {
10+ throw new Error ( 'Incorrect endpoint provided. Expected format: wss://<account name>.gremlin.cosmos.' ) ;
11+ }
12+ const endpoint = `https://${ dbName [ 1 ] } .documents.azure.com:443/` ;
1013 const key = connectionInfo . accountKey ;
1114
1215 return new CosmosClient ( { endpoint, key } ) ;
You can’t perform that action at this time.
0 commit comments