mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 15:46:44 +00:00
Launcher, app/base, sentry, update service
This commit is contained in:
@ -26,7 +26,6 @@ import (
|
||||
|
||||
pkgMessage "github.com/ProtonMail/proton-bridge/pkg/message"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/pmapi"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/sentry"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
@ -247,22 +246,6 @@ func (p *PMAPIProvider) generateImportMsgReq(rules transferRules, progress *Prog
|
||||
func (p *PMAPIProvider) parseMessage(msg Message) (m *pmapi.Message, r []io.Reader, err error) {
|
||||
p.timeIt.start("parse", msg.ID)
|
||||
defer p.timeIt.stop("parse", msg.ID)
|
||||
|
||||
// Old message parser is panicking in some cases.
|
||||
// Instead of crashing we try to convert to regular error.
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = fmt.Errorf("panic while parse: %v", r)
|
||||
if sentryErr := sentry.ReportSentryCrash(
|
||||
p.clientConfig.ClientID,
|
||||
p.clientConfig.AppVersion,
|
||||
p.clientConfig.UserAgent,
|
||||
err,
|
||||
); sentryErr != nil {
|
||||
log.Error("Sentry crash report failed: ", sentryErr)
|
||||
}
|
||||
}
|
||||
}()
|
||||
message, _, _, attachmentReaders, err := pkgMessage.Parse(bytes.NewBuffer(msg.Body))
|
||||
return message, attachmentReaders, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user