From b3f1356e54f7d0bc0a59fd0a323ee1d89e648ef2 Mon Sep 17 00:00:00 2001 From: Ashley Gibson Date: Sat, 29 Jan 2022 09:47:50 +0000 Subject: [PATCH] Log failed API requests. --- src/API/v1/CreateRelease.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/API/v1/CreateRelease.php b/src/API/v1/CreateRelease.php index ec02c3a..fdc9f20 100644 --- a/src/API/v1/CreateRelease.php +++ b/src/API/v1/CreateRelease.php @@ -149,6 +149,8 @@ public function handle(\WP_REST_Request $request): \WP_REST_Response return new \WP_REST_Response($release->toArray(), 201); } catch (\Exception $e) { + edd_debug_log(sprintf('SL Releases - CreateRelease - API error: %s', $e->getMessage())); + return new \WP_REST_Response(['error' => $e->getMessage()], $e->getCode() ? : 500); } }