Skip to content

Commit 3953774

Browse files
committed
fix(api/schemas): handle unknown error type in Next.js API route and ensure pnpm is installed first in CI workflow
1 parent ceb033f commit 3953774

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.github/workflows/CI.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414

15+
- name: Install pnpm
16+
run: npm install -g pnpm
17+
1518
- name: Use Node.js 20.x
1619
uses: actions/setup-node@v4
1720
with:
1821
node-version: 20
1922
cache: 'pnpm'
2023

21-
- name: Install pnpm
22-
run: npm install -g pnpm
23-
2424
- name: Install dependencies
2525
run: pnpm install
2626

app/api/schemas/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export async function GET() {
1313
}));
1414
return NextResponse.json({ schemas });
1515
} catch (error) {
16-
return NextResponse.json({ error: error.message }, { status: 500 });
16+
const message = error instanceof Error ? error.message : String(error);
17+
return NextResponse.json({ error: message }, { status: 500 });
1718
}
1819
}

0 commit comments

Comments
 (0)