I am using the Klarna SDK to implement their payment methods. The SDK calls the api and checks the response code. If the response-code is not 0 (all codes > 0 are errors) an exception is thrown. In my controller I try to catch the exception to handle it. But in the development enviroment the "exception detected" comes first.
vendor/.../klarna/.../function.php
public function xy() {
$status = $this->getResponse();
if($status > 0) throw new KlarnaException(...);
}
src/AppBundle/Controller/MyController
public function indexAction() {
$k = new Klarna();
try {
$k->xy();
} catch(Exception $e) {
die('Something wrent wrong');
}
}
But the catch() is never executed because the execution stopps when detecting the exception in the vendor. How to prevent debuggin vendor classes?