This commit is contained in:
Pinga 2025-06-16 14:25:55 +03:00
parent c8591faa04
commit 251eaeab2e
2 changed files with 6 additions and 2 deletions

View file

@ -177,12 +177,14 @@ $http->on('request', function ($request, $response) use ($c, $pool, $log, $rateL
$response->status(500); $response->status(500);
$response->header('Content-Type', 'application/rdap+json'); $response->header('Content-Type', 'application/rdap+json');
$response->end(json_encode(['Database error:' => $e->getMessage()])); $response->end(json_encode(['Database error:' => $e->getMessage()]));
return;
} catch (Throwable $e) { } catch (Throwable $e) {
// Catch any other exceptions or errors // Catch any other exceptions or errors
$log->error('Error: ' . $e->getMessage()); $log->error('Error: ' . $e->getMessage());
$response->status(500); $response->status(500);
$response->header('Content-Type', 'application/rdap+json'); $response->header('Content-Type', 'application/rdap+json');
$response->end(json_encode(['Error:' => $e->getMessage()])); $response->end(json_encode(['General error:' => $e->getMessage()]));
return;
} finally { } finally {
// Return the connection to the pool // Return the connection to the pool
$pool->put($pdo); $pool->put($pdo);

View file

@ -177,12 +177,14 @@ $http->on('request', function ($request, $response) use ($c, $pool, $log, $rateL
$response->status(500); $response->status(500);
$response->header('Content-Type', 'application/rdap+json'); $response->header('Content-Type', 'application/rdap+json');
$response->end(json_encode(['Database error:' => $e->getMessage()])); $response->end(json_encode(['Database error:' => $e->getMessage()]));
return;
} catch (Throwable $e) { } catch (Throwable $e) {
// Catch any other exceptions or errors // Catch any other exceptions or errors
$log->error('Error: ' . $e->getMessage()); $log->error('Error: ' . $e->getMessage());
$response->status(500); $response->status(500);
$response->header('Content-Type', 'application/rdap+json'); $response->header('Content-Type', 'application/rdap+json');
$response->end(json_encode(['Error:' => $e->getMessage()])); $response->end(json_encode(['General error:' => $e->getMessage()]));
return;
} finally { } finally {
// Return the connection to the pool // Return the connection to the pool
$pool->put($pdo); $pool->put($pdo);