Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEVTOOLING-926: Optional stack trace recovery & logging #1516

Merged
merged 19 commits into from
Feb 13, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor refactor
charliecon committed Jan 31, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 07206c65566d0c12fe71bb0c5c9545884fbe02dd
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ func GetPanicRecoveryLoggerInstance() *PanicRecoveryLogger {
func (p *PanicRecoveryLogger) HandleRecovery(r any, operation constants.CRUDOperation) (err error) {
if operation == constants.Create {
err = fmt.Errorf("creation failed becasue of stack trace: %s. There may be dangling resource left in your org", r)
} else if operation == constants.Read && p.isExporterActiveAttr() {
} else if operation == constants.Read && p.isExporterActive() {
err = fmt.Errorf("failed to export resource because of stack trace: %s", r)
}

@@ -69,6 +69,10 @@ func (p *PanicRecoveryLogger) WriteStackTracesToFile(r any) error {
return p.writeStackTracesToFileAttr(p, r)
}

func (p *PanicRecoveryLogger) isExporterActive() bool {
return p.isExporterActiveAttr()
}

// appendToFile appends data to a file. If the file does not exist, it will be created.
func appendToFile(filename string, data []byte) (err error) {
defer func() {