File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
packages/nx-plugin/src/executors/cli Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,25 @@ import { executeProcess } from '../../internal/execute-process.js';
33import {
44 createCliCommandObject ,
55 createCliCommandString ,
6- formatCommandLog ,
7- objectToCliArgs ,
86} from '../internal/cli.js' ;
97import { normalizeContext } from '../internal/context.js' ;
108import type { AutorunCommandExecutorOptions } from './schema.js' ;
119import { mergeExecutorOptions , parseAutorunExecutorOptions } from './utils.js' ;
1210
11+ export function stringifyError ( error : unknown ) : string {
12+ // TODO: special handling for ZodError instances
13+ if ( error instanceof Error ) {
14+ if ( error . name === 'Error' || error . message . startsWith ( error . name ) ) {
15+ return error . message ;
16+ }
17+ return `${ error . name } : ${ error . message } ` ;
18+ }
19+ if ( typeof error === 'string' ) {
20+ return error ;
21+ }
22+ return JSON . stringify ( error ) ;
23+ }
24+
1325export type ExecutorOutput = {
1426 success : boolean ;
1527 command ?: string ;
You can’t perform that action at this time.
0 commit comments