Based on your comment here's your problem
namespace Something;
class myClass {
function method() {
try {
$entity->$pivotMethod()->attach( $rowData->get_key(), $ext );
} catch (Exception $e) {
$err = $e->getMessage()."\n";
error_log($err);
}
}
}
In this case you're typehinting that you're catching an exception but you don't specify a scope so PHP is assuming you're catching \Something\Exception
The fix is pretty simple. Adding a \
tells PHP to catch anything that is, or extends, the base Exception
class
catch (\Exception $e)