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:
@@ -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,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user