mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #2547] [MERGED] fix(import): surface real error instead of 500 when character import throws #5648
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5648
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2547
Author: @Gunterlie
Created: 6/12/2026
Status: ✅ Merged
Merged: 6/13/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/import-unhandled-500📝 Commits (1)
48944f8fix(import): surface real error instead of 500 when character import throws📊 Changes
2 files changed (+29 additions, -14 deletions)
View changed files
📝
packages/server/src/routes/import.routes.ts(+26 -13)📝
packages/server/src/services/import/st-character.importer.ts(+3 -1)📄 Description
Problem
importSTCharacterwas called without atry/catchin three places inside the import route:POST /import/st-characterfrom bot browser / JSON card drop)importCharacterBufferfor.pnguploads)importCharacterBufferfor.jsonuploads)Any uncaught exception — most commonly the embedded lorebook rollback failure — escaped to Fastify's global error handler, which returned a generic HTTP 500
{ error: "Internal Server Error" }. The client displayed this as an opaque toast with no actionable information.The JSON buffer path had a
try/catchbut it wrapped bothJSON.parseandimportSTCharactertogether, so real import errors were swallowed and reported as "Invalid file format" — also wrong.Fix
importSTCharactercall sites so failures return{ success: false, error }with the actual error message (orString(err)if the thrown value isn't anErrorobject).try/catchso parse errors and import errors are reported separately with accurate messages.Test plan
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.