File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/main/java/org/springdoc/maven/plugin Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ public class SpringDocMojo extends AbstractMojo {
104104 */
105105 private static final String GET = "GET" ;
106106
107- public void execute () {
107+ public void execute () throws MojoFailureException {
108108 if (skip ) {
109109 getLog ().info ("Skip execution as per configuration" );
110110 return ;
@@ -121,7 +121,7 @@ public void execute() {
121121 Files .write (Paths .get (outputDir .getAbsolutePath () + "/" + outputFileName ), result .getBytes (StandardCharsets .UTF_8 ));
122122 if (attachArtifact ) addArtifactToMaven ();
123123 } else {
124- String message = "An error has occurred: Response code " + responseCode ;
124+ String message = "An error has occurred, response code: " + responseCode ;
125125 if (failOnError ) {
126126 throw new MojoFailureException (message );
127127 } else {
@@ -130,6 +130,9 @@ public void execute() {
130130 }
131131 } catch (Exception e ) {
132132 getLog ().error ("An error has occurred" , e );
133+ if (failOnError ) {
134+ throw new MojoFailureException ("An error has occurred: " + e .getMessage ());
135+ }
133136 }
134137 }
135138
You can’t perform that action at this time.
0 commit comments