feat(mal): add comprehensive error handling
MALFunctions.go: - Update MALHelper to return (json.RawMessage, string, error) - Add network error handling and proper request error checking - Update GetMyAnimeList to return (MALWatchlist, error) - Update MyAnimeListUpdate to return (MalListStatus, error) - Update GetMyAnimeListAnime to return (MALAnime, error) - Update DeleteMyAnimeListEntry to return (bool, error) MALUserFunctions.go: - Replace log.Fatalf with log.Printf in server error handling - Prevent server shutdown on OAuth callback errors All MAL API calls now properly propagate errors to frontend.
This commit is contained in:
@@ -176,7 +176,7 @@ func (a *App) handleMyAnimeListCallback(wg *sync.WaitGroup, verifier *CodeVerifi
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
if err := srv.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
|
||||
log.Fatalf("listen: %s\n", err)
|
||||
log.Printf("Server error: %s\n", err)
|
||||
}
|
||||
fmt.Println("Shutting down...")
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user