just to be sure: recover from panics in processSourceBody()!

This commit is contained in:
Wouter Groeneveld 2021-04-25 15:45:00 +02:00
parent 529bf932b8
commit 2812130d75
1 changed files with 5 additions and 0 deletions

View File

@ -46,6 +46,11 @@ func (recv *Receiver) processSourceBody(body string, wm mf.Mention) {
log.Warn().Str("target", wm.Target).Msg("ABORT: no mention of target found in html src of source!")
return
}
defer func() {
if r := recover(); r != nil {
log.Error().Str("panic", fmt.Sprintf("%q", r)).Stringer("wm", wm).Msg("ABORT: panic recovery while processing wm")
}
}()
data := microformats.Parse(strings.NewReader(body), wm.SourceUrl())
indieweb := recv.convertBodyToIndiewebData(body, wm, data)