summaryrefslogtreecommitdiff
path: root/cmd/pdfbook/main.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2019-11-29 11:53:34 +0000
committerNick White <git@njw.name>2019-11-29 11:53:34 +0000
commit329686ac970b459aefdd29b6c044e662cbe1be80 (patch)
tree5c9143a6f185b7a8572c18eb57524a4fc6d95541 /cmd/pdfbook/main.go
parent92b8af6c81105323912db2300808b87f623970a1 (diff)
Make error message clear what page is causing issues
Diffstat (limited to 'cmd/pdfbook/main.go')
-rw-r--r--cmd/pdfbook/main.go3
1 files changed, 2 insertions, 1 deletions
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