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