Skip to content

Conversation

@CodeMaverick-143
Copy link

Fix undefined panicLog error in handler

Description:

  • Fixed a compilation error in pkg/gofr/handler.go caused by the usage of an undefined/unexported struct panicLog.
  • Replaced the manual panic logging implementation with the exported helper function logging.LogPanic.
  • Removed the unused runtime/debug import to keep imports clean.
  • This change ensures that panic recovery correctly logs stack traces using the centralized logging logic.

Breaking Changes (if applicable):

  • None. This is a fix for a build error and implementation detail.

Additional Information:

  • The error occurred because panicLog is defined in the logging package but is not exported, so it could not be initialized directly from gofr. Using logging.LogPanic resolves this access issue.

Checklist:

  • I have formatted my code using goimport and golangci-lint.
  • All new code is covered by unit tests.
  • This PR does not decrease the overall code coverage.
  • I have reviewed the code comments and documentation for clarity.

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.

1 participant