File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
openapi-generator/lib/src Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -132,9 +132,14 @@ class OpenapiGenerator extends GeneratorForAnnotation<annots.Openapi> {
132
132
break ;
133
133
case annots.Generator .DART_DIO :
134
134
case annots.Generator .DART_JAGUAR :
135
- var runnerOutput = await runSourceGen (outputDirectory);
136
- print (
137
- 'OpenapiGenerator :: build runner exited with code ${runnerOutput .exitCode } ::' );
135
+ try {
136
+ var runnerOutput = await runSourceGen (outputDirectory);
137
+ print (
138
+ 'OpenapiGenerator :: build runner exited with code ${runnerOutput .exitCode } ::' );
139
+ } catch (e) {
140
+ print (e);
141
+ print ('OpenapiGenerator :: could not complete source gen ::' );
142
+ }
138
143
break ;
139
144
}
140
145
}
@@ -146,9 +151,10 @@ class OpenapiGenerator extends GeneratorForAnnotation<annots.Openapi> {
146
151
}
147
152
148
153
Future <ProcessResult > runSourceGen (String outputDirectory) async {
149
- print ('OpenapiGenerator :: running source code generations ::' );
154
+ print ('OpenapiGenerator :: running source code generation ::' );
150
155
var c = 'pub run build_runner build --delete-conflicting-outputs' ;
151
- var runnerOutput = await Process .run ('flutter' , c.split (' ' ).toList (),
156
+ ProcessResult runnerOutput;
157
+ runnerOutput = await Process .run ('flutter' , c.split (' ' ).toList (),
152
158
runInShell: Platform .isWindows, workingDirectory: '$outputDirectory ' );
153
159
print (runnerOutput.stderr);
154
160
return runnerOutput;
You can’t perform that action at this time.
0 commit comments