Get a list of errors for a given build, since a given time.
@param $buildId
@param string $since date string
@return array
514335
public function getErrorsForBuild($buildId, $since = null)
    {
        $query = 'SELECT * FROM build_error
                    WHERE build_id = :build';

        if (!is_null($since)) {
            $query .= ' AND created_date > :since';
        }

        $query .= ' LIMIT 15000';

        $stmt = Database::getConnection('read')->prepare($query);

        $stmt->bindValue(':build', $buildId, \PDO::PARAM_INT);

        if (!is_null($since)) {
            $stmt->bindValue(':since', $since);
        }

        if ($stmt->execute()) {
            $res = $stmt->fetchAll(\PDO::FETCH_ASSOC);

            $map = function ($item) {
                return new BuildError($item);
            };
            $rtn = array_map($map, $res);

            return $rtn;
        } else {
            return array();
        }
    }
820836
public function build($build_path = null, ConnectionInterface $connection = null, array $event_handlers = [])
    {
        $builders = $this->getBuilders($build_path, $connection, $event_handlers);

        foreach ($builders as $builder) {
            $builder->preBuild();
        }

        foreach ($this->types as $type) {
            foreach ($builders as $builder) {
                $builder->buildType($type);
            }
        }

        foreach ($builders as $builder) {
            $builder->postBuild();
        }
    }
584747
public static function getUploadErrorMessage($errorId)
    {
        $messagesArray = self::getUploadErrorMessages();
        return isset($messagesArray[$errorId]) ? $messagesArray[$errorId] : 'Unknown upload error.';
    }
1207744
@RequestMapping(value = "builds/{buildId}/links/from", method = RequestMethod.GET)
    public Resources<Build> getBuildLinksFrom(@PathVariable ID buildId) {
        return Resources.of(
                structureService.getBuildLinksFrom(structureService.getBuild(buildId)),
                uri(on(getClass()).getBuildLinksFrom(buildId))
        ).forView(Build.class);
    }
1259300
function (commit, until) {
            var checker = this;

            until = !isNaN(until) ? until : (new Date()).getTime() + (this.getOption('timeout'));

            if ((new Date()).getTime() > until) {
                return this.handleError('Timeout');
            }

            return this.getBuilds()
                .then(function (builds) {
                    if (undefined !== builds.message) {
                        return checker.handleError(builds.message);
                    }

                    var finder = new BuildFinder(builds),
                        builds = finder.findByCommit(commit);

                    if (null === builds) {
                        return checker.handleError('Build not found');
                    }

                    return builds;
                }, this.handleError)

                .then(function (builds) {
                    var successfulBuilds = 0;

                    for (var i = 0; i < builds.length; i++) {
                        if (builds[i].isSuccess()) {
                            successfulBuilds++;
                        } else if (builds[i].isFailure() || !checker.getOption('retryOnRunning')) {
                            return checker.handleError('Invalid status for CircleCI build: "' + builds[i].getStatus() + '"')
                        }
                    }

                    if (successfulBuilds === builds.length) {
                        return true;
                    }

                    // Sleep for 10 seconds by default
                    var promise = sleep(checker.getOption('retryAfter'));

                    return promise.then(function () {
                        return checker.checkCommit(commit, until);
                    });
                }, this.handleError);
        }
318558
public function getJobs($writerId, $since = null, $until = null)
    {
        $url = parse_url($this->getBaseUrl());
        $componentName = substr($url['path'], 1);
        $url = "https://{$url['host']}/queue/jobs?component={$componentName}&q=params.writerId={$writerId}";
        if ($since) {
            $url .= '&since=' . urlencode($since);
        }
        if ($until) {
            $url .= '&until=' . urlencode($until);
        }
        return $this->get($url)->send()->json();
    }
1134572
public function getErrorsForUpgrade($limit)
    {
        $query = 'SELECT * FROM build_meta
                    WHERE meta_key IN (\'phpmd-data\', \'phpcs-data\', \'phpdoccheck-data\')
                    ORDER BY id ASC LIMIT :limit';

        $stmt = Database::getConnection('read')->prepare($query);

        $stmt->bindValue(':limit', $limit, \PDO::PARAM_INT);

        if ($stmt->execute()) {
            $res = $stmt->fetchAll(\PDO::FETCH_ASSOC);

            $map = function ($item) {
                return new BuildMeta($item);
            };
            $rtn = array_map($map, $res);

            return $rtn;
        } else {
            return array();
        }
    }
1214371
public function getErrors($format = true)
    {
        if (!$format) {
            return $this->errors;
        }

        $formatted = array();

        foreach ($this->errors as $error) {
            $formatted[] = $this->getFormattedError($error);
        }

        return $formatted;
    }
1120819
public function getDocumentRoot(string $buildId = null): ?string
    {
        $documentRoot = $this->getCodePath($buildId);

        if ($this->getRelativeDocumentRoot()) {
            $documentRoot .= '/' . $this->getRelativeDocumentRoot();
        }

        return $documentRoot;
    }
549222
public function errorInfo()
	{
		return array
		(
			0 => $this->driver->getSQLState(),
			1 => $this->driver->getErrorCode(),
			2 => $this->driver->getLastMessage()
		);
	}
1035976
public function getAllUsers(string $since = null): array
    {
        return $this->getApi()->request($this->getApi()
                                             ->sprintf('/users?:args', http_build_query(['since' => $since])));
    }
456190
private function _buildDates()
    {
        if ( !$this->from || !$this->to || $this->from > $this->to ) {
            return;
        }
        $this->dates = array();
        $d = clone $this->from;
        $this->dates[] = clone $d;
        while ( $d != $this->to ) {
            $d->add(new \DateInterval('P1D'));
            $this->dates[] = clone $d;
        }
    }
372202
public function builds($projectId)
    {
        $branch = $this->getParam('branch', '');
        $builds = $this->getLatestBuildsHtml($projectId, urldecode($branch));

        $this->response->disableLayout();
        $this->response->setContent($builds[0]);
        return $this->response;
    }
1273001
public function listGists(string $username = null, string $since = '1970-01-01'): array
    {
        $url = '/gists';
        if (null !== $username) {
            $url = '/users/:username/gists';
        }

        return $this->getApi()->request($this->getApi()->sprintf(':url?:arg', $url, $username,
            http_build_query(['since' => (new DateTime($since))->format(DateTime::ATOM)])));
    }
19698
public function getErrors()
    {
        $errors = array();

        $entityContainers = $this->getEntityContainerMap()->getAll();

        /**
         * @var EntityContainerInterface $entityContainer
         */
        foreach ($entityContainers as $entityContainer) {
            if ($entityContainer->hasErrors()) {
                $errors[$entityContainer->getName()] = $entityContainer->getErrors();
            }
        }

        return $errors;
    }
961411
public List<BuildChangeSet> getChangeSets() {
        List<BuildChangeSet> result;
        if (changeSets != null) {
            result = changeSets;
        } else if (changeSet != null) {
            result = Collections.singletonList(changeSet);
        } else {
            result = null;
	}
        return result;
    }
1087916
public function listRepositories($since = null)
	{
		$data = array();
		if(!is_null($since))
			$data['since'] = $since;
		
		return $this->client->request("/repositories", 'GET', $data, 200, 'GitHubSimpleRepo', true);
	}