Release: staging -> main (2026-06-09 06:42)#981
Open
github-actions[bot] wants to merge 21 commits into
Open
Conversation
🎯 What: Extracted formatCaughtError from papers.ts to a dedicated errors.ts utility file and added comprehensive unit tests to close a testing gap. 📊 Coverage: Added unit test cases to cover standard Error objects, custom Error objects, string errors, numbers, null/undefined values, and generic objects. ✨ Result: Increased test coverage for error utility formatting, reducing regression risk by having deterministic tests that confirm the safety net catches errors reliably. Co-authored-by: is0692vs <135803462+is0692vs@users.noreply.github.com>
Co-authored-by: is0692vs <135803462+is0692vs@users.noreply.github.com>
Co-authored-by: is0692vs <135803462+is0692vs@users.noreply.github.com>
Bumps the github-actions-all group with 1 update: [codecov/codecov-action](https://github.com/codecov/codecov-action). Updates `codecov/codecov-action` from 6 to 7 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v6...v7) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions-all ... Signed-off-by: dependabot[bot] <support@github.com>
…5ad269 🧪 Extract formatCaughtError and add unit tests
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Comment on lines
+1
to
+5
| export function formatCaughtError(error: unknown): string { | ||
| return error instanceof Error | ||
| ? `${error.name}: ${error.message}` | ||
| : String(error); | ||
| } |
Contributor
There was a problem hiding this comment.
非 Error オブジェクトの文字列化に
String(value) を使用しているため、{ code: 500, message: "DB timeout" } のようなプレーンオブジェクトがスローされた場合、ログには "[object Object]" しか残らず、デバッグに役立つ情報が完全に失われます。テストのコメントでも "intentionally" と記されていますが、JSON.stringify でフォールバックすることで同様の後方互換性を保ちつつ有用な情報を残せます。
Suggested change
| export function formatCaughtError(error: unknown): string { | |
| return error instanceof Error | |
| ? `${error.name}: ${error.message}` | |
| : String(error); | |
| } | |
| export function formatCaughtError(error: unknown): string { | |
| if (error instanceof Error) { | |
| return `${error.name}: ${error.message}`; | |
| } | |
| try { | |
| return JSON.stringify(error); | |
| } catch { | |
| return String(error); | |
| } | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/api/src/utils/errors.ts
Line: 1-5
Comment:
非 Error オブジェクトの文字列化に `String(value)` を使用しているため、`{ code: 500, message: "DB timeout" }` のようなプレーンオブジェクトがスローされた場合、ログには `"[object Object]"` しか残らず、デバッグに役立つ情報が完全に失われます。テストのコメントでも "intentionally" と記されていますが、`JSON.stringify` でフォールバックすることで同様の後方互換性を保ちつつ有用な情報を残せます。
```suggestion
export function formatCaughtError(error: unknown): string {
if (error instanceof Error) {
return `${error.name}: ${error.message}`;
}
try {
return JSON.stringify(error);
} catch {
return String(error);
}
}
```
How can I resolve this? If you propose a fix, please make it concise.…hub-actions-all-484570b1b1 chore(deps): bump codecov/codecov-action from 6 to 7 in the github-actions-all group
Co-authored-by: is0692vs <135803462+is0692vs@users.noreply.github.com>
…680999085744576 chore: prevent false positive TODO in OSV auto fix workflow comment
Co-authored-by: is0692vs <135803462+is0692vs@users.noreply.github.com>
Co-authored-by: is0692vs <135803462+is0692vs@users.noreply.github.com>
Co-authored-by: is0692vs <135803462+is0692vs@users.noreply.github.com>
Fix BadgeSnippet copy button accessible labels
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Promotes
stagingintomain.stagingmainnpm run pr:promoteIncluded PRs
Compare