fix frontend to display backend error messages to users

the backend was correctly returning helpful error messages (like "search query is too long..."), but the frontend was only showing "search failed: Bad Request" because it only read response.statusText and never read the response body.

now when an API error occurs, the frontend:
1. reads the response body text
2. displays the actual error message from the backend
3. falls back to statusText if body reading fails

this means users will now see the full helpful message: "search query is too long (max 1024 characters for text search). try a shorter query."

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Changed files
+12 -1
static
+12 -1
static/index.html
··· 691 }); 692 693 if (!response.ok) { 694 - throw new Error(`search failed: ${response.statusText}`); 695 } 696 697 const data = await response.json();
··· 691 }); 692 693 if (!response.ok) { 694 + // try to extract error message from response body 695 + let errorMessage = response.statusText; 696 + try { 697 + const errorText = await response.text(); 698 + // actix-web returns plain text error messages, not JSON 699 + if (errorText) { 700 + errorMessage = errorText; 701 + } 702 + } catch (e) { 703 + // if reading body fails, use the status text 704 + } 705 + throw new Error(errorMessage); 706 } 707 708 const data = await response.json();