İçeriğe geç

Yeniden Fırlatma İz Kaybı (ARCH7154)

Anahtar php.logging.rethrow-without-previous · Önem warning · Kategori logging

Bir handler içinde orijinal istisnayı previous parametresi olarak geçirmeden yeni bir istisna fırlatmak, kök neden ve yığın izini yok eder.

<?php
try {
$this->client->request($url);
} catch (TransportException $e) {
throw new ServiceException('Upstream call failed');
}
<?php
try {
$this->client->request($url);
} catch (TransportException $e) {
throw new ServiceException('Upstream call failed', 0, $e);
}

Yeni istisnayı fırlatırken orijinal istisnayı previous (üçüncü) argüman olarak iletin.