1- import { ContentstackClient , sanitizePath , log } from '@contentstack/cli-utilities' ;
1+ import { ContentstackClient , sanitizePath , log , formatError } from '@contentstack/cli-utilities' ;
22import * as path from 'path' ;
33import { QueryExportConfig , Modules } from '../types' ;
44import { QueryParser } from '../utils/query-parser' ;
@@ -169,7 +169,7 @@ export class QueryExporter {
169169 fsUtil . writeFile ( sanitizePath ( contentTypesFilePath ) , contentTypes ) ;
170170 log . success ( 'Referenced content types export completed successfully' , this . exportQueryConfig . context ) ;
171171 } catch ( error ) {
172- log . error ( `Error exporting referenced content types: ${ error . message } ` , this . exportQueryConfig . context ) ;
172+ log . error ( `Error exporting referenced content types: ${ formatError ( error ) } ` , this . exportQueryConfig . context ) ;
173173 throw error ;
174174 }
175175 }
@@ -248,7 +248,7 @@ export class QueryExporter {
248248
249249 log . success ( 'Dependent modules export completed successfully' , this . exportQueryConfig . context ) ;
250250 } catch ( error ) {
251- log . error ( `Error exporting dependent modules: ${ error . message } ` , this . exportQueryConfig . context ) ;
251+ log . error ( `Error exporting dependent modules: ${ formatError ( error ) } ` , this . exportQueryConfig . context ) ;
252252 throw error ;
253253 }
254254 }
@@ -268,7 +268,7 @@ export class QueryExporter {
268268
269269 log . success ( 'Content modules export completed successfully' , this . exportQueryConfig . context ) ;
270270 } catch ( error ) {
271- log . error ( `Error exporting content modules: ${ error . message } ` , this . exportQueryConfig . context ) ;
271+ log . error ( `Error exporting content modules: ${ formatError ( error ) } ` , this . exportQueryConfig . context ) ;
272272 throw error ;
273273 }
274274 }
@@ -283,7 +283,7 @@ export class QueryExporter {
283283
284284 log . success ( 'Entries export completed successfully' , this . exportQueryConfig . context ) ;
285285 } catch ( error ) {
286- log . error ( `Error exporting entries: ${ error . message } ` , this . exportQueryConfig . context ) ;
286+ log . error ( `Error exporting entries: ${ formatError ( error ) } ` , this . exportQueryConfig . context ) ;
287287 throw error ;
288288 }
289289 }
@@ -423,7 +423,7 @@ export class QueryExporter {
423423 log . info ( 'No referenced assets found in entries' , this . exportQueryConfig . context ) ;
424424 }
425425 } catch ( error ) {
426- log . error ( `Error exporting referenced assets: ${ error . message } ` , this . exportQueryConfig . context ) ;
426+ log . error ( `Error exporting referenced assets: ${ formatError ( error ) } ` , this . exportQueryConfig . context ) ;
427427 throw error ;
428428 }
429429 }
0 commit comments