From 329686ac970b459aefdd29b6c044e662cbe1be80 Mon Sep 17 00:00:00 2001 From: Nick White Date: Fri, 29 Nov 2019 11:53:34 +0000 Subject: Make error message clear what page is causing issues --- cmd/pdfbook/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/pdfbook/main.go b/cmd/pdfbook/main.go index 6532f26..9f97543 100644 --- a/cmd/pdfbook/main.go +++ b/cmd/pdfbook/main.go @@ -2,6 +2,7 @@ package main import ( "bufio" + "errors" "flag" "fmt" "log" @@ -82,7 +83,7 @@ func addBest(dir string, pdf Pdfer, colour, smaller bool) error { img := imgPath(hocrpath, colour) err := pdf.AddPage(img, hocrpath, smaller) if err != nil { - return err + return errors.New(fmt.Sprintf("Failed to add page %s: %v", f, err)) } } return nil -- cgit v1.2.1-24-ge1ad