diff options
author | Nick White <git@njw.name> | 2019-11-29 11:53:34 +0000 |
---|---|---|
committer | Nick White <git@njw.name> | 2019-11-29 11:53:34 +0000 |
commit | 329686ac970b459aefdd29b6c044e662cbe1be80 (patch) | |
tree | 5c9143a6f185b7a8572c18eb57524a4fc6d95541 /cmd | |
parent | 92b8af6c81105323912db2300808b87f623970a1 (diff) |
Make error message clear what page is causing issues
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/pdfbook/main.go | 3 |
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 |