summaryrefslogtreecommitdiff
path: root/cmd/rescribe/gui.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/rescribe/gui.go')
-rw-r--r--cmd/rescribe/gui.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/rescribe/gui.go b/cmd/rescribe/gui.go
index 8790f03..73f1db2 100644
--- a/cmd/rescribe/gui.go
+++ b/cmd/rescribe/gui.go
@@ -134,14 +134,18 @@ func trainingSelectOnChange(sel *widget.Select, parent fyne.Window) func(string)
newpath := filepath.Join(os.Getenv("TESSDATA_PREFIX"), name)
f, err := os.Create(newpath)
if err != nil {
- // TODO: surface error somewhere, prob with a dialog box
+ msg := fmt.Sprintf("Error creating temporary file to store custom training: %v\n", err)
+ dialog.ShowError(errors.New(msg), parent)
+ fmt.Fprintf(os.Stderr, msg)
sel.SetSelectedIndex(0)
return
}
defer f.Close()
_, err = io.Copy(f, uri)
if err != nil {
- // TODO: surface error somewhere, prob with a dialog box
+ msg := fmt.Sprintf("Error copying custom training to temporary file: %v\n", err)
+ dialog.ShowError(errors.New(msg), parent)
+ fmt.Fprintf(os.Stderr, msg)
sel.SetSelectedIndex(0)
return
}