Skip to content

Commit

Permalink
Log failed API requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleyfae committed Jan 29, 2022
1 parent eed49d9 commit b3f1356
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/API/v1/CreateRelease.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit b3f1356

Please sign in to comment.