mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-21 10:06:05 +02:00
RDAP fix
This commit is contained in:
parent
c8591faa04
commit
251eaeab2e
2 changed files with 6 additions and 2 deletions
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue