Skip to content

Commit

Permalink
Minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
charliecon committed Jan 31, 2025
1 parent ff3a904 commit 07206c6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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() {
Expand Down

0 comments on commit 07206c6

Please sign in to comment.