Skip to content

Log error message and stack trace in SocialMediaService catch handlers#91

Merged
Danswar merged 1 commit into
developfrom
fix/socialmedia-logger-error-trace
Apr 17, 2026
Merged

Log error message and stack trace in SocialMediaService catch handlers#91
Danswar merged 1 commit into
developfrom
fix/socialmedia-logger-error-trace

Conversation

@TaprootFreak
Copy link
Copy Markdown

Summary

  • Passing an Error object as the second argument to NestJS's Logger.error() makes it interpret the error as trace: string. The logger then calls toString(), which only yields "Error: <msg>" and drops the actual stack.
  • Log lines like error [SocialMediaService]: Error while sending saving updates: appear without any detail — the real cause is silently lost.
  • Changes all six catch handlers to log ${e.message} in the message and pass e.stack as the trace argument.

Test plan

  • Confirm next SocialMediaService exception in deploy logs includes the error message + stack

@TaprootFreak TaprootFreak requested a review from Danswar April 17, 2026 10:53
@Danswar Danswar merged commit bbc0abc into develop Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants