1
0
mirror of git://f0xx.org/ac/ac-be-builder synced 2026-08-12 18:12:50 +03:00

Builder: fail gracefully on artifact mkdir and notify on enqueue errors.

Use failBuild instead of throwing on permission errors, sendmail/SMTP
fallback for notifications, correct broadcast config path, always alert admin.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Anton Afanasyeu
2026-08-07 22:45:52 +02:00
parent c1eb7be233
commit 08747faf82
4 changed files with 56 additions and 13 deletions

View File

@@ -32,5 +32,15 @@ if (!isset($params['trigger_source'])) {
}
$user = Auth::user();
$build = BuildRunner::enqueue($params, isset($user['id']) ? (int) $user['id'] : null);
json_out(['ok' => true, 'build' => $build]);
try {
$build = BuildRunner::enqueue($params, isset($user['id']) ? (int) $user['id'] : null);
} catch (Throwable $e) {
error_log('[build_trigger] ' . $e->getMessage());
json_out(['ok' => false, 'error' => BuildErrorSanitizer::sanitize($e->getMessage())], 500);
}
$failed = (($build['status'] ?? '') === 'failed');
json_out([
'ok' => !$failed,
'build' => $build,
'error' => $failed ? (string) ($build['error_message'] ?? 'Build failed to start') : null,
]);