UTDNebula/utd-trends

[Feature Request] More specific RMP summary errors

開放

#610 建立於 2026年4月7日

 (6 則留言) (1 個反應) (1 位負責人)TypeScript (35 個分叉)auto 404
Good First IssueType: Feature Request

倉庫指標

星標
 (28 顆星)
PR 合併指標
 (平均合併 16天 20小時) (30 天內合併 1 個 PR)

描述

Overview

Currently the RMP summary route can return errors for things like API keys not being defined, but also for there not being any reviews on a RMP page. All these errors display as "Problem loading AI RMP Summary". See: https://trends.utdnebula.com/dashboard?searchTerms=Tahrima+Rahman&availability=26F which only has 2 reviews so in src\app\api\rmpSummary\route.ts the below is returned:

if (rmp.ratings.edges.length < 5) {
  return NextResponse.json(
    { message: 'error', data: 'Not enough ratings for a summary' },
    { status: 500 },
  );
}

but in src\components\common\RmpSummary\RmpSummary.tsx only the below is rendered.

if (status === 'error') {
  return <p>Problem loading AI review summary.</p>;
}

Proposal

Update the error display of the RmpSummary component to read the specific error returned from the API and display a more descriptive error message. We can leave our internal errors like missing API key and incorrect query parameters as "Problem loading AI RMP Summary". But the two RMP related errors should be more descriptive.

貢獻者指南