Example usage for com.amazonaws.services.codebuild.model BuildPhase getContexts

List of usage examples for com.amazonaws.services.codebuild.model BuildPhase getContexts

Introduction

In this page you can find the example usage for com.amazonaws.services.codebuild.model BuildPhase getContexts.

Prototype


public java.util.List<PhaseContext> getContexts() 

Source Link

Document

Additional information about a build phase, especially to help troubleshoot a failed build.

Usage

From source file:CodeBuildAction.java

License:Open Source License

public String getPhaseErrorMessage() {
    BuildPhase errorPhase = getErrorPhase();
    if (errorPhase == null) {
        return "";
    } else {/*  w  w w.j  av  a  2  s.  co  m*/
        if (!errorPhase.getContexts().isEmpty()) {
            String ret = errorPhase.getContexts().get(0).getMessage().replace("'", "").replace("\n", "")
                    + " (status code: " + errorPhase.getContexts().get(0).getStatusCode() + ")";
            return ret;
        } else {
            return "";
        }
    }
}