Apply suggestions from code review
authorMarcel Werk <burntime@woltlab.com>
Wed, 27 Oct 2021 08:25:48 +0000 (10:25 +0200)
committerGitHub <noreply@github.com>
Wed, 27 Oct 2021 08:25:48 +0000 (10:25 +0200)
Co-authored-by: Tim Düsterhus <duesterhus@woltlab.com>
wcfsetup/install/files/lib/action/PaypalCallbackAction.class.php

index 3d32d561778bcb730148240e88c33d7fe5b47ff8..db1801f2ce3edf7d01932469e6760d98f9bcda11 100644 (file)
@@ -49,13 +49,13 @@ class PaypalCallbackAction extends AbstractAction
                 $response = $client->send($request);
                 $content = (string)$response->getBody();
             } catch (ClientExceptionInterface $e) {
-                throw new SystemException('connection to paypal.com failed: ' . $e->getMessage());
+                throw new \Exception('PayPal IPN validation request failed: ' . $e->getMessage(), 0, $e);
             }
 
             if (\strpos($content, "VERIFIED") === false) {
-                throw new SystemException('request not validated');
+                throw new \Exception("PayPal IPN validation did not return 'VERIFIED'.");
             }
-        } catch (SystemException $e) {
+        } catch (\Exception $e) {
             \wcf\functions\exception\logThrowable($e);
             return new EmptyResponse(500);
         }
@@ -127,7 +127,7 @@ class PaypalCallbackAction extends AbstractAction
             }
 
             $this->executed();
-        } catch (SystemException $e) {
+        } catch (\Exception $e) {
             \wcf\functions\exception\logThrowable($e);
         }