fix(cli): improve project metadata loading and normalize CLI error handling
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import * as plugins from '../../plugins.js';
|
||||
import * as paths from '../../../paths.js';
|
||||
import { tspmIpcClient } from '../../../client/tspm.ipcclient.js';
|
||||
import { Logger } from '../../../shared/common/utils.errorhandler.js';
|
||||
import { handleError, Logger } from '../../../shared/common/utils.errorhandler.js';
|
||||
import type { CliArguments } from '../../types.js';
|
||||
import { formatMemory } from '../../helpers/memory.js';
|
||||
|
||||
@@ -76,7 +76,7 @@ export function registerDaemonCommand(smartcli: plugins.smartcli.Smartcli) {
|
||||
// Disconnect from the daemon after starting
|
||||
await tspmIpcClient.disconnect();
|
||||
} catch (error) {
|
||||
console.error('Error starting daemon:', error.message);
|
||||
console.error('Error starting daemon:', handleError(error).message);
|
||||
process.exit(1);
|
||||
}
|
||||
break;
|
||||
@@ -139,7 +139,7 @@ export function registerDaemonCommand(smartcli: plugins.smartcli.Smartcli) {
|
||||
// Disconnect from the daemon after stopping
|
||||
await tspmIpcClient.disconnect();
|
||||
} catch (error) {
|
||||
console.error('Error stopping daemon:', error.message);
|
||||
console.error('Error stopping daemon:', handleError(error).message);
|
||||
process.exit(1);
|
||||
}
|
||||
break;
|
||||
@@ -169,7 +169,7 @@ export function registerDaemonCommand(smartcli: plugins.smartcli.Smartcli) {
|
||||
// Disconnect from daemon after getting status
|
||||
await tspmIpcClient.disconnect();
|
||||
} catch (error) {
|
||||
console.error('Error getting daemon status:', error.message);
|
||||
console.error('Error getting daemon status:', handleError(error).message);
|
||||
process.exit(1);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user