fix(cli): improve project metadata loading and normalize CLI error handling
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import * as plugins from '../../plugins.js';
|
||||
import { TspmServiceManager } from '../../../client/tspm.servicemanager.js';
|
||||
import { Logger } from '../../../shared/common/utils.errorhandler.js';
|
||||
import { handleError, Logger } from '../../../shared/common/utils.errorhandler.js';
|
||||
import type { CliArguments } from '../../types.js';
|
||||
|
||||
export function registerDisableCommand(smartcli: plugins.smartcli.Smartcli) {
|
||||
@@ -18,10 +18,11 @@ export function registerDisableCommand(smartcli: plugins.smartcli.Smartcli) {
|
||||
console.log(' The daemon will no longer start on system boot');
|
||||
console.log(' Use "tspm enable" to re-enable the service');
|
||||
} catch (error) {
|
||||
console.error('Error disabling service:', error.message);
|
||||
const errorMessage = handleError(error).message;
|
||||
console.error('Error disabling service:', errorMessage);
|
||||
if (
|
||||
error.message.includes('permission') ||
|
||||
error.message.includes('denied')
|
||||
errorMessage.includes('permission') ||
|
||||
errorMessage.includes('denied')
|
||||
) {
|
||||
console.log('\nNote: You may need to run this command with sudo');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user