This repository was archived by the owner on Jun 24, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,10 @@ func (h *Handler) FollowShare(c *gin.Context) {
9595 videoUrl , err = utils .ScrapeFromHTML (postId )
9696 if err != nil || videoUrl == "" {
9797 slog .Error ("Failed to scrape video URL from HTML. Trying to make an API request..." , slog .Any ("err" , err ))
98- sentry .CaptureException (err )
98+
99+ if err != nil {
100+ sentry .CaptureException (err )
101+ }
99102
100103 // 2: Try to get the post data from an API request
101104 data , err := utils .FetchPost (postId )
@@ -158,6 +161,7 @@ func (h *Handler) FollowShare(c *gin.Context) {
158161 CdnURL : videoUrl ,
159162 }).Error
160163 if err != nil {
164+ sentry .CaptureException (err )
161165 slog .Error ("Failed to save cdn url to memory database" , slog .Any ("err" , err ))
162166 }
163167 }
Original file line number Diff line number Diff line change @@ -81,7 +81,10 @@ func (h *Handler) ServeVideo(c *gin.Context) {
8181 videoUrl , err = utils .ScrapeFromHTML (postId )
8282 if err != nil || videoUrl == "" {
8383 slog .Error ("Failed to scrape video URL from HTML. Trying to make an API request..." , slog .Any ("err" , err ))
84- sentry .CaptureException (err )
84+
85+ if err != nil {
86+ sentry .CaptureException (err )
87+ }
8588
8689 // 2: Try to get the post data from an API request
8790 data , err := utils .FetchPost (postId )
@@ -145,6 +148,7 @@ func (h *Handler) ServeVideo(c *gin.Context) {
145148 CdnURL : videoUrl ,
146149 }).Error
147150 if err != nil {
151+ sentry .CaptureException (err )
148152 slog .Error ("Failed to save cdn url to memory database" , slog .Any ("err" , err ))
149153 }
150154 }
You can’t perform that action at this time.
0 commit comments