Package org.gradle.api.tasks

Examples of org.gradle.api.tasks.TaskExecutionException


                logger.debug("Action stopped by some action with message: {}", e.getMessage());
            } catch (StopExecutionException e) {
                logger.info("Execution stopped by some action with message: {}", e.getMessage());
                break;
            } catch (Throwable t) {
                return new TaskExecutionException(task, t);
            } finally {
                task.getStandardOutputCapture().stop();
            }
        }
        return null;
View Full Code Here


        }});

        executer.execute(task, state);

        assertThat(wrappedFailure.get(), instanceOf(TaskExecutionException.class));
        TaskExecutionException exception = (TaskExecutionException) wrappedFailure.get();
        assertThat(exception.getTask(), equalTo((Task) task));
        assertThat(exception.getMessage(), equalTo("Execution failed for <task>."));
        assertThat(exception.getCause(), sameInstance(failure));
    }
View Full Code Here

            }
        }

        if (source == null) {
            if (actualException instanceof TaskExecutionException) {
                TaskExecutionException taskExecutionException = (TaskExecutionException) actualException;
                source = ((ProjectInternal) taskExecutionException.getTask().getProject()).getBuildScriptSource();
            }
        }

        return generator.newInstance(actualException.getClass(), actualException, source, lineNumber);
    }
View Full Code Here

      if (_exitValue != 0) {
        getLogger().lifecycle("Error while generating PDF.");
        getLogger().lifecycle("Manual PDF has not been created.");
      }
    } catch (IOException | InterruptedException e) {
      throw new TaskExecutionException(this, e);
    }
  }
View Full Code Here

      getLogger().lifecycle(
        "Colorizer processed {} files and modified {}.",
        colorizer.getProcessed(), colorizer.getModified()
      );
    } catch (final IOException e) {
      throw new TaskExecutionException(this, e);
    }
  }
View Full Code Here

      // Write the checksum file.
      try (FileOutputStream out = new FileOutputStream(getChecksumFile())) {
        out.write(toString(digest.digest()).getBytes());
      }
    } catch (NoSuchAlgorithmException | IOException e) {
      throw new TaskExecutionException(this, e);
    }
  }
View Full Code Here

                logger.debug("Action stopped by some action with message: {}", e.getMessage());
            } catch (StopExecutionException e) {
                logger.info("Execution stopped by some action with message: {}", e.getMessage());
                break;
            } catch (Throwable t) {
                return new TaskExecutionException(task, t);
            } finally {
                task.getStandardOutputCapture().stop();
            }
        }
        return null;
View Full Code Here

        }});

        executer.execute(task, state, executionContext);

        assertThat(wrappedFailure.get(), instanceOf(TaskExecutionException.class));
        TaskExecutionException exception = (TaskExecutionException) wrappedFailure.get();
        assertThat(exception.getTask(), equalTo((Task) task));
        assertThat(exception.getMessage(), equalTo("Execution failed for <task>."));
        assertThat(exception.getCause(), sameInstance(failure));
    }
View Full Code Here

    }

    @Test
    public void prefersScriptExceptionOverContextualException() {
        Throwable cause = new GradleScriptException("broken", new ContextualException());
        Throwable failure = new TaskExecutionException(null, cause);

        Throwable transformedFailure = analyser().transform(failure);
        assertThat(transformedFailure, instanceOf(LocationAwareException.class));

        LocationAwareException gse = (LocationAwareException) transformedFailure;
View Full Code Here

    }

    @Test
    public void prefersLocationAwareExceptionOverScriptException() {
        Throwable cause = locationAwareException(new GradleScriptException("broken", new RuntimeException()));
        Throwable failure = new TaskExecutionException(null, cause);

        DefaultExceptionAnalyser analyser = analyser();

        assertThat(analyser.transform(failure), sameInstance(cause));
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.tasks.TaskExecutionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.