1.2.243. Converted Exceptions

Converted exceptions is when an exception is caught, then immediately converted into another one and thrown again.

Sometimes, extra operations take place, such as logging or error couting.

<?php

try {
     doSomething();
} catch (MyException $e) {
     log($e->getMessage());
     throw new BadRequestException();
}

?>

1.2.243.1. Specs

Short name

Exceptions/ConvertedExceptions

Rulesets

All, Analyze

Exakat since

2.5.3

PHP Version

All

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

High

Features

exception, try

Available in

Entreprise Edition, Exakat Cloud