File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
components/ironclad/actions Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -88,13 +88,17 @@ export default {
8888 return response ;
8989 } catch ( error ) {
9090 const msg = JSON . parse ( error . message ) ;
91+ const { schema } = await ironclad . getWorkflowSchema ( {
92+ templateId,
93+ } ) ;
9194 if ( msg . code === "MISSING_PARAM" ) {
92- const { schema } = await this . ironclad . getWorkflowSchema ( {
93- templateId : this . templateId ,
94- } ) ;
9595 const paramNames = ( JSON . parse ( msg . param ) ) . map ( ( p ) => `\`${ schema [ p ] . displayName } \`` ) ;
9696 throw new ConfigurationError ( `Please enter or update the following required parameters: ${ paramNames . join ( ", " ) } ` ) ;
9797 }
98+ if ( msg . code === "INVALID_PARAM" ) {
99+ const paramName = schema [ msg . metadata . keyPath ] . displayName ;
100+ throw new ConfigurationError ( `Invalid parameter: \`${ paramName } \`. ${ msg . message } ` ) ;
101+ }
98102 throw new ConfigurationError ( msg . message ) ;
99103 }
100104 } ,
Original file line number Diff line number Diff line change @@ -95,13 +95,17 @@ export default {
9595 return response ;
9696 } catch ( error ) {
9797 const msg = JSON . parse ( error . message ) ;
98+ const { schema } = await ironclad . getWorkflow ( {
99+ workflowId,
100+ } ) ;
98101 if ( msg . code === "MISSING_PARAM" ) {
99- const { schema } = await this . ironclad . getWorkflowSchema ( {
100- templateId : this . templateId ,
101- } ) ;
102102 const paramNames = ( JSON . parse ( msg . param ) ) . map ( ( p ) => `\`${ schema [ p ] . displayName } \`` ) ;
103103 throw new ConfigurationError ( `Please enter or update the following required parameters: ${ paramNames . join ( ", " ) } ` ) ;
104104 }
105+ if ( msg . code === "INVALID_PARAM" ) {
106+ const paramName = schema [ msg . metadata . keyPath ] . displayName ;
107+ throw new ConfigurationError ( `Invalid parameter: \`${ paramName } \`. ${ msg . message } ` ) ;
108+ }
105109 throw new ConfigurationError ( msg . message ) ;
106110 }
107111 } ,
You can’t perform that action at this time.
0 commit comments