@@ -51,7 +51,7 @@ export class Plugin {
5151 const response = await this . process ! . sendMessageForResult ( { cmd : 'validate' , data : { configs : rawConfigs } } ) ;
5252
5353 if ( ! this . validateValidateResponse ( response ) ) {
54- throw new Error ( `Invalid validate response from plugin: ${ this . name } ` ) ;
54+ throw new Error ( `Plugin error: Invalid validate response from plugin: ${ this . name } ` ) ;
5555 }
5656
5757 return response ;
@@ -61,7 +61,7 @@ export class Plugin {
6161 const response = await this . process ! . sendMessageForResult ( { cmd : 'plan' , data : resource . raw } ) ;
6262
6363 if ( ! this . validatePlanResponse ( response ) ) {
64- throw new Error ( `Plugin error: plugin ${ this . name } returned invalid plan response` )
64+ throw new Error ( `Plugin error: plugin ${ this . name } returned invalid plan response: ${ JSON . stringify ( planResponseValidator . errors , null , 2 ) } ` )
6565 }
6666
6767 return response ;
@@ -71,31 +71,15 @@ export class Plugin {
7171 await this . process ! . sendMessageForResult ( { cmd : 'apply' , data : { plan } } ) ;
7272 }
7373
74- destroy ( ) {
75- this . process ! . killPlugin ( ) ;
76- }
77-
7874 private validateInitializeResponse ( response : unknown ) : response is InitializeResponseData {
79- if ( ! initializeResponseValidator ( response ) ) {
80- throw new Error ( `Invalid initialize response from plugin: ${ this . name } . Error: ${ initializeResponseValidator . errors } ` )
81- }
82-
83- return true ;
75+ return initializeResponseValidator ( response )
8476 }
8577
8678 private validateValidateResponse ( response : unknown ) : response is ValidateResponseData {
87- if ( ! validateResponseValidator ( response ) ) {
88- throw new Error ( `Invalid validate response from plugin: ${ this . name } . Error: ${ initializeResponseValidator . errors } ` )
89- }
90-
91- return true ;
79+ return validateResponseValidator ( response )
9280 }
9381
9482 private validatePlanResponse ( response : unknown ) : response is PlanResponseData {
95- if ( ! planResponseValidator ( response ) ) {
96- throw new Error ( `Invalid plan response from plugin: ${ this . name } . Error: ${ initializeResponseValidator . errors } ` )
97- }
98-
99- return true ;
83+ return planResponseValidator ( response ) ;
10084 }
10185}
0 commit comments