amruthpillai/reactive-resume · error · ORPCError
INTERNAL_SERVER_ERROR
INTERNAL_SERVER_ERROR
Error message
Failed to create resume
What it means
resumeService.create() wraps the DB insert; if it fails for any reason other than the resume_slug_user_id_unique constraint (mapped to RESUME_SLUG_ALREADY_EXISTS), it logs the cause and throws INTERNAL_SERVER_ERROR. The underlying error is written to the server console, not the response.
Source
Thrown at packages/api/src/features/resume/service.ts:650
await notifyResumeUpdated({
type: "resume.updated",
resumeId: id,
userId: input.userId,
updatedAt: new Date().toISOString(),
mutation: "create",
});
return id;
} catch (error) {
const constraint = get(error, "cause.constraint") as string | undefined;
if (constraint === "resume_slug_user_id_unique") {
throw new ORPCError("RESUME_SLUG_ALREADY_EXISTS", { status: 400 });
}
console.error("Failed to create resume:", error);
throw new ORPCError("INTERNAL_SERVER_ERROR", { message: "Failed to create resume" });
}
},
update: async (input: {
id: string;
userId: string;
name?: string;
slug?: string;
tags?: string[];
data?: ResumeData;
isPublic?: boolean;
restoreStylesheet?: boolean;
skipAutoSnapshot?: boolean;
}) => {
const resume = await db
.transaction(async (tx) => {
const [existing] = await tx
.select({View on GitHub (pinned to 3a5b12e2a4)
Solutions
- Check server logs for 'Failed to create resume:' with the full cause.
- Verify the DB is reachable and migrations are applied (dotenvx run -f .env.local -- pnpm db:migrate).
- Confirm no required column is null in the payload.
- If it is a transient DB error (connection/serialization), retry the create.
Defensive patterns
Strategy: try-catch
Validate before calling
function buildCreateInput(input) {
if (!input.name || !input.slug) throw new Error('name and slug required');
if (!/^[a-z0-9-]+$/.test(input.slug)) throw new Error('Invalid slug');
return input;
} Try / catch
try {
await resumeService.create(input);
} catch (e) {
if (e.code === 'RESUME_SLUG_ALREADY_EXISTS') { /* pick a new slug */ }
else if (e.code === 'INTERNAL_SERVER_ERROR') {
// check server logs; retry only if DB was transiently down
} else throw e;
} Prevention
- Ensure the DB is up and migrations are applied before creating resumes.
- Pre-check slug uniqueness to surface RESUME_SLUG_ALREADY_EXISTS gracefully.
- Retry creates only on transient DB errors, never blindly.
When it happens
Trigger: DB connection loss, a NOT NULL or constraint violation other than the slug unique, schema drift between the Drizzle model and the live table, a serialization failure, or a duplicate generated id.
Common situations: DATABASE_URL misconfigured or the DB is down, a pending migration not applied, a new required column without a default, or transient DB instability.
Related errors
- INTERNAL_SERVER_ERROR
- INTERNAL_SERVER_ERROR
- An unknown error occurred while validating the merged resume
- INTERNAL_SERVER_ERROR
- NOT_FOUND
AI-assisted analysis of amruthpillai/reactive-resume@3a5b12e2a4 (2026-08-12).
Data as JSON: /api/errors/6faf6646fc9c2a6d.
Report an issue: GitHub.