@@ -370,6 +370,7 @@ export default class ServiceCheck extends ProjectCommand {
370370 const decodedErrors = compositionValidationResult . errors
371371 . filter ( isNotNullOrUndefined )
372372 . map ( error => {
373+ // checks for format: [serviceName] Location -> Error Message
373374 const match = error . message . match (
374375 / ^ \[ ( [ ^ \[ ] + ) \] \s + ( \S + ) \ - > \ ( .+ ) /
375376 ) ;
@@ -639,22 +640,38 @@ export default class ServiceCheck extends ProjectCommand {
639640 // Add a cosmetic line break
640641 console . log ( "" ) ;
641642
642- this . log (
643- table (
644- [
645- [ "Service" , "Field" , "Message" ] ,
646- ...compositionErrors . map ( Object . values )
647- ] ,
648- {
649- columns : {
650- 2 : {
651- width : 50 ,
652- wrapWord : true
643+ // errors that DONT match the expected format: [service] field -> message
644+ const unformattedErrors = compositionErrors . filter (
645+ e => ! e . field && ! e . service
646+ ) ;
647+ // errors that match the expected format: [service] field -> message
648+ const formattedErrors = compositionErrors . filter (
649+ e => e . field || e . service
650+ ) ;
651+
652+ if ( formattedErrors . length )
653+ this . log (
654+ table (
655+ [
656+ [ "Service" , "Field" , "Message" ] ,
657+ ...formattedErrors . map ( Object . values )
658+ ] ,
659+ {
660+ columns : {
661+ 2 : {
662+ width : 50 ,
663+ wrapWord : true
664+ }
653665 }
654666 }
655- }
656- )
657- ) ;
667+ )
668+ ) ;
669+
670+ // list out errors which we couldn't determine Service name and/or location names
671+ if ( unformattedErrors . length )
672+ this . log (
673+ table ( [ [ "Message" ] , ...unformattedErrors . map ( e => [ e . message ] ) ] )
674+ ) ;
658675
659676 // Return a non-zero error code
660677 this . exit ( 1 ) ;
0 commit comments