Skip to content

Commit

Permalink
[TASK] Be more explicit about exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaskienast committed Jul 14, 2023
1 parent d75958b commit 0e7d47e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion config/packages/framework.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
framework:
secret: '%env(APP_SECRET)%'
#csrf_protection: true
#http_method_override: true
http_method_override: false
trusted_proxies: '%env(TRUSTED_PROXIES)%'
trusted_headers: [ 'x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port', 'x-forwarded-prefix' ]

# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
Expand Down
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, $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, $payload->repository->full_name, $payload->ref), 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 0e7d47e

Please sign in to comment.