mirror of
https://github.com/mendableai/firecrawl.git
synced 2026-01-08 05:04:15 +00:00
fix(api): improve error logging with structured error object (#1697)
This commit is contained in:
parent
7ed19c0ac0
commit
e06ec2d047
@ -235,25 +235,14 @@ app.use(
|
||||
}
|
||||
|
||||
const id = res.sentry ?? uuidv4();
|
||||
let verbose = JSON.stringify(err);
|
||||
if (verbose === "{}") {
|
||||
if (err instanceof Error) {
|
||||
verbose = JSON.stringify({
|
||||
message: err.message,
|
||||
name: err.name,
|
||||
stack: err.stack,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
logger.error(
|
||||
"Error occurred in request! (" +
|
||||
req.path +
|
||||
") -- ID " +
|
||||
id +
|
||||
" -- " +
|
||||
verbose,
|
||||
);
|
||||
" -- ",
|
||||
{ error: err });
|
||||
res.status(500).json({
|
||||
success: false,
|
||||
error:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user