@@ -166,10 +166,11 @@ async function dbCheck(e: any): Promise<void> {
166166 { name : "graphredex-qry" , access : "ro" } ,
167167 ] ;
168168
169- console . log ( "Getting users" ) ;
169+ console . log ( "Getting users: " ) ;
170170 const users : Map < string , any > = new Map (
171- ( await api ( "/_db/_system/_api/user/" ) ) . map ( ( u ) => [ u . user , u ] ) ,
171+ ( await api ( "/_db/_system/_api/user/" ) . catch ( console . error ) ) . map ( ( u ) => [ u . user , u ] ) ,
172172 ) ;
173+ console . log ( `Users found: ${ [ ...users . keys ( ) ] . join ( ", " ) } ` ) ;
173174
174175 for ( const { name : userName } of graphredexUsers ) {
175176 console . log ( `Checking ${ userName } ` ) ;
@@ -248,7 +249,7 @@ async function getRootDbAPIConnection(): Promise<
248249 return ( path : string , options : any = { } ) =>
249250 new Promise ( ( resolve , reject ) => {
250251 needle (
251- "get" ,
252+ options . method ?? "get" ,
252253 "http://localhost:8529" + path ,
253254 options . body ,
254255 {
@@ -257,20 +258,23 @@ async function getRootDbAPIConnection(): Promise<
257258 } ,
258259 json : true ,
259260 } ,
260- ( _err , _res , body ) => {
261- if ( ! body . error ) {
262- resolve ( body . result ) ;
263- } else {
264- reject ( body ) ;
265- }
266- } ,
267- ) ;
261+ )
262+ . then ( ( { body} ) => {
263+ if ( ! body . error ) {
264+ console . log ( body ) ;
265+ resolve ( body . result ) ;
266+ } else {
267+ reject ( body ) ;
268+ }
269+ } )
270+ . catch ( e => reject ( e ) ) ;
268271 } ) ;
269272}
270273
271274function getRootPass ( ) : Promise < string > {
272275 return new Promise ( ( resolve ) => {
273276 if ( "ARANGO_ROOT_PASSWORD" in process . env ) {
277+ console . log ( "Got root pass from env" ) ;
274278 resolve ( process . env . ARANGO_ROOT_PASSWORD ) ;
275279 } else {
276280 console . log ( "Type root password:" ) ;
0 commit comments