Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

Stop Wrapping Errors in TypeScript. Use `cause` Instead.

DEV Community·Gabriel Anhaia·27 days ago
#ruxYwzCu
Reading 0:00
15s threshold

Book: TypeScript Essentials — From Working Developer to Confident TS, Across Node, Bun, Deno, and the Browser Also by me: The TypeScript Library — the 5-book collection My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools Me: xgabriel.com | GitHub You open a postmortem. The error in the log says Error: Failed to load user profile: invalid input syntax for type uuid . You read it twice. You know which function threw it because its message has the literal string Failed to load user profile , but the part after the colon is from somewhere four layers below, and the stack trace goes back as far as the function that did the wrapping. The original pg error has been flattened into a string. The file, the line, and the SQL state code that would tell you who handed in a bad UUID are gone. Whoever wrote that wrapper threw away the only piece of the puzzle you actually needed. This is a self-inflicted wound.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More