Skip to content

Commit

Permalink
fix: add more logs for troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
npenin committed Nov 16, 2024
1 parent 0317652 commit 8d61887
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/pm/src/akala.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import { Readable } from 'stream';
import { spawnAsync } from './cli-helper.js';
import State, { StateConfiguration } from './state.js';
import { CliContext, ErrorMessage, InteractError, NamespaceMiddleware, unparse } from '@akala/cli';
import { eachAsync, ObservableObject, Parser } from '@akala/core';
import { eachAsync, logger, ObservableObject, Parser } from '@akala/core';
import module from 'module'
import commands from './container.js';

const log = logger('akala:pm');

const require = module.createRequire(import.meta.url);

const tableChars = {
Expand Down Expand Up @@ -78,12 +80,16 @@ export default async function (_config, program: NamespaceMiddleware<{ configFil
return;
try
{
log.verbose('trying to connect to ' + connectionString);
container = await connect(new URL(connectionString), c.abort.signal, metaContainer);
}
catch (e)
{
log.silly('failed to connect to ' + connectionString);
log.silly(e)
if (e.code == 'ENOENT' || e.code == 'ECONNREFUSED')
return;
log.error(e);
throw e;
}

Expand Down

0 comments on commit 8d61887

Please sign in to comment.