@@ -161,7 +161,7 @@ func (h *APIHandler) HandleGetPackage(w http.ResponseWriter, r *http.Request) {
161161
162162 info , err := h .enrichment .EnrichPackage (r .Context (), ecosystem , name )
163163 if err != nil {
164- http .Error (w , err . Error () , http .StatusInternalServerError )
164+ http .Error (w , "failed to enrich package" , http .StatusInternalServerError )
165165 return
166166 }
167167
@@ -209,7 +209,7 @@ func (h *APIHandler) HandleGetVersion(w http.ResponseWriter, r *http.Request) {
209209
210210 result , err := h .enrichment .EnrichFull (r .Context (), ecosystem , name , version )
211211 if err != nil {
212- http .Error (w , err . Error () , http .StatusInternalServerError )
212+ http .Error (w , "failed to enrich version" , http .StatusInternalServerError )
213213 return
214214 }
215215
@@ -291,7 +291,7 @@ func (h *APIHandler) HandleGetVulns(w http.ResponseWriter, r *http.Request) {
291291
292292 vulns , err := h .enrichment .CheckVulnerabilities (r .Context (), ecosystem , name , version )
293293 if err != nil {
294- http .Error (w , err . Error () , http .StatusInternalServerError )
294+ http .Error (w , "failed to check vulnerabilities" , http .StatusInternalServerError )
295295 return
296296 }
297297
@@ -485,7 +485,7 @@ func (h *APIHandler) HandleSearch(w http.ResponseWriter, r *http.Request) {
485485 // Search in database
486486 results , err := h .db .SearchPackages (query , ecosystem , limit , (page - 1 )* limit )
487487 if err != nil {
488- http .Error (w , err . Error () , http .StatusInternalServerError )
488+ http .Error (w , "search failed" , http .StatusInternalServerError )
489489 return
490490 }
491491
@@ -592,7 +592,7 @@ func (h *APIHandler) HandlePackagesList(w http.ResponseWriter, r *http.Request)
592592
593593 packages , err := h .db .ListCachedPackages (ecosystem , sortBy , limit , (page - 1 )* limit )
594594 if err != nil {
595- http .Error (w , err . Error () , http .StatusInternalServerError )
595+ http .Error (w , "failed to list packages" , http .StatusInternalServerError )
596596 return
597597 }
598598
0 commit comments