Skip to content

Commit

Permalink
[TASK] Be more explicit about exceptions (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaskienast authored Jul 14, 2023
1 parent 6b2114f commit ae9c362
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Service/WebHookService.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private function getPushEventFromGithub(Request $request): array
if (is_object($payload) && isset($payload->repository)) {
$cloneUrl = $payload->repository->clone_url;
}
throw new GitBranchDeletedException('Webhook was triggered on a deleted branch for repository' . $cloneUrl . '.', 1564408696);
throw new GitBranchDeletedException(sprintf('Webhook was triggered on deleted branch %s for repository %s.', $payload->ref ?? '[unknown]', $cloneUrl), 1564408696);
}

// Only for actual push events, not releases
Expand All @@ -154,7 +154,7 @@ private function getPushEventFromGithub(Request $request): array
}

if (!$triggeringChange) {
throw new DocsNoRstChangesException('Branch has no RST changes.', 1570011098);
throw new DocsNoRstChangesException(sprintf('The commit %s pushed to %s:%s doesn\'t contain any changed .rst files', $payload->head_commit?->id ?? '[unknown]', $payload->repository?->full_name ?? '[unknown]', $payload->ref ?? '[unknown]'), 1570011098);
}
}

Expand Down
6 changes: 6 additions & 0 deletions templates/docs_deployments/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@
<span class="message-detail-value">{{ log.data.composerFile }}</span>
</div>
{% endif %}
{% if log.data.exceptionMessage is defined %}
<div class="message-detail-item">
<span class="message-detail-key">Reason</span>
<span class="message-detail-value">{{ log.data.exceptionMessage }}</span>
</div>
{% endif %}
{% if log.data.exceptionCode is defined %}
<div class="message-detail-item">
<span class="message-detail-key">Exception Code</span>
Expand Down

0 comments on commit ae9c362

Please sign in to comment.