mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-16 07:06:45 +00:00
Convert panics from message parser to error
This commit is contained in:
@ -36,7 +36,6 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
|
|||||||
* golang.org/x/text v0.3.2 -> v0.3.3
|
* golang.org/x/text v0.3.2 -> v0.3.3
|
||||||
* Set first-start to false in bridge, not in frontend.
|
* Set first-start to false in bridge, not in frontend.
|
||||||
* GODT-400 Refactor sendingInfo.
|
* GODT-400 Refactor sendingInfo.
|
||||||
|
|
||||||
* GODT-380 Adding IE GUI to Bridge repo and building
|
* GODT-380 Adding IE GUI to Bridge repo and building
|
||||||
* BR: extend functionality of PopupDialog
|
* BR: extend functionality of PopupDialog
|
||||||
* BR: makefile APP_VERSION instead of BRIDGE_VERSION
|
* BR: makefile APP_VERSION instead of BRIDGE_VERSION
|
||||||
@ -49,6 +48,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
|
|||||||
* IE: Added event watch in GUI
|
* IE: Added event watch in GUI
|
||||||
* IE: Removed `onLoginFinished`
|
* IE: Removed `onLoginFinished`
|
||||||
* Structure for transfer rules in QML
|
* Structure for transfer rules in QML
|
||||||
|
* GODT-213 Convert panics from message parser to error.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
* GODT-655 Fix date picker with automatic Windows DST
|
* GODT-655 Fix date picker with automatic Windows DST
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Code generated by ./credits.sh at Fri Aug 21 10:29:43 CEST 2020. DO NOT EDIT.
|
// Code generated by ./credits.sh at Mon Aug 31 15:08:14 CEST 2020. DO NOT EDIT.
|
||||||
|
|
||||||
package bridge
|
package bridge
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Code generated by ./release-notes.sh at 'Thu Aug 20 14:25:06 CEST 2020'. DO NOT EDIT.
|
// Code generated by ./release-notes.sh at 'Mon Aug 31 15:08:14 CEST 2020'. DO NOT EDIT.
|
||||||
|
|
||||||
package bridge
|
package bridge
|
||||||
|
|
||||||
|
|||||||
@ -185,7 +185,9 @@ func (f *frontendCLI) setTransferRules(t *transfer.Transfer) bool {
|
|||||||
|
|
||||||
func (f *frontendCLI) printTransferProgress(progress *transfer.Progress) {
|
func (f *frontendCLI) printTransferProgress(progress *transfer.Progress) {
|
||||||
failed, imported, exported, added, total := progress.GetCounts()
|
failed, imported, exported, added, total := progress.GetCounts()
|
||||||
f.Println(fmt.Sprintf("Progress update: %d (%d / %d) / %d, failed: %d", imported, exported, added, total, failed))
|
if total != 0 {
|
||||||
|
f.Println(fmt.Sprintf("Progress update: %d (%d / %d) / %d, failed: %d", imported, exported, added, total, failed))
|
||||||
|
}
|
||||||
|
|
||||||
if progress.IsPaused() {
|
if progress.IsPaused() {
|
||||||
f.Printf("Transfer is paused bacause %s", progress.PauseReason())
|
f.Printf("Transfer is paused bacause %s", progress.PauseReason())
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Code generated by ./credits.sh at Fri Aug 21 10:29:44 CEST 2020. DO NOT EDIT.
|
// Code generated by ./credits.sh at Mon Aug 31 15:08:14 CEST 2020. DO NOT EDIT.
|
||||||
|
|
||||||
package importexport
|
package importexport
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Code generated by ./release-notes.sh at 'Fri Aug 21 14:17:14 CEST 2020'. DO NOT EDIT.
|
// Code generated by ./release-notes.sh at 'Mon Aug 31 15:08:14 CEST 2020'. DO NOT EDIT.
|
||||||
|
|
||||||
package importexport
|
package importexport
|
||||||
|
|
||||||
|
|||||||
@ -206,7 +206,14 @@ func (p *PMAPIProvider) generateImportMsgReq(msg Message, globalMailbox *Mailbox
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PMAPIProvider) parseMessage(msg Message) (*pmapi.Message, []io.Reader, error) {
|
func (p *PMAPIProvider) parseMessage(msg Message) (m *pmapi.Message, r []io.Reader, err error) {
|
||||||
|
// 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("%v", r)
|
||||||
|
}
|
||||||
|
}()
|
||||||
message, _, _, attachmentReaders, err := pkgMessage.Parse(bytes.NewBuffer(msg.Body), "", "")
|
message, _, _, attachmentReaders, err := pkgMessage.Parse(bytes.NewBuffer(msg.Body), "", "")
|
||||||
return message, attachmentReaders, err
|
return message, attachmentReaders, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user