Skip to content

Commit

Permalink
backend: books: skip books that generate error on author creation
Browse files Browse the repository at this point in the history
  • Loading branch information
ericswpark committed Apr 21, 2024
1 parent 276645c commit dd81ada
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions backend/src/app/api/v0/books/search/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,8 @@ export async function GET(request: NextRequest) {
gbooks_target_book.volumeInfo.authors[0],
);
} catch (error) {
if (error instanceof TypeError) {
// This book doesn't have an author, skip
continue;
} else {
throw error;
}
// This book probably doesn't have an author, skip
continue;
}

// Check if book already exists in the database
Expand Down

0 comments on commit dd81ada

Please sign in to comment.