summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-10 10:32:45 -0400
committerPietro Gagliardi <[email protected]>2014-03-10 10:32:45 -0400
commit65663c05331f93b1fa94533ef206a0aaa2827896 (patch)
tree5d3d318ae1c6a47e7fa8c8e76ca5831d37380bc2
parent51fea6be87ed0a3f2dc1be396cea250f234a59b9 (diff)
Changed Windows sysData.setText() to panic on error. WM_SETTEXT's documentation indicates the main error is memory exhausted, which means we should panic anyway (unless the Go runtime already has). Any other error will be flagged as unexpected; since we're using SetWindowText() we can't differentiate between out of memory and other errors in the way WM_SETTEXT documents anyway.
-rw-r--r--sysdata_windows.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdata_windows.go b/sysdata_windows.go
index a0935c9..798076b 100644
--- a/sysdata_windows.go
+++ b/sysdata_windows.go
@@ -254,7 +254,7 @@ func (s *sysData) setText(text string) error {
}
r := <-ret
if r.ret == 0 { // failure
- return r.err
+ panic(fmt.Errorf("error setting window/control text: %v", err))
}
return nil
}