From db02a63848dc063e04399955236a3c5d586ee861 Mon Sep 17 00:00:00 2001 From: Lukas Schwab Date: Mon, 6 Jan 2025 19:59:49 -0500 Subject: [PATCH] Fix text initialization upon WebMetadata fetch failure --- cmd/tir/cmd/create.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/tir/cmd/create.go b/cmd/tir/cmd/create.go index f0316f5..074cd12 100644 --- a/cmd/tir/cmd/create.go +++ b/cmd/tir/cmd/create.go @@ -31,11 +31,12 @@ func init() { } func fromUrl(url string) { - initial, err := web.WebMetadata(url) - if err != nil { + if initial, err := web.WebMetadata(url); err != nil { log.Printf("coultn't read '%s'; skipping: %v", url, err) + from(&text.Text{URL: url}) + } else { + from(initial) } - from(initial) } func from(initial *text.Text) {