aboutsummaryrefslogtreecommitdiff
path: root/nexgb/ge
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-11 23:58:52 -0400
committerAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-11 23:58:52 -0400
commit29942bf078c92fea681e42ca5029592526f00718 (patch)
treecee802ebe16e0b118c9be0f6265e26d31e8a5845 /nexgb/ge
parentfb3128ed2a83a0f644661cedebbe5bfda3f4951e (diff)
downloadhaven-29942bf078c92fea681e42ca5029592526f00718.tar.gz
haven-29942bf078c92fea681e42ca5029592526f00718.tar.xz
haven-29942bf078c92fea681e42ca5029592526f00718.zip
panic when an extension request is issued before an extension has been initialized. but give a nice error message for the happy people.
Diffstat (limited to 'nexgb/ge')
-rw-r--r--nexgb/ge/ge.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/nexgb/ge/ge.go b/nexgb/ge/ge.go
index 42a60ea..e7592d8 100644
--- a/nexgb/ge/ge.go
+++ b/nexgb/ge/ge.go
@@ -2,7 +2,7 @@
package ge
/*
- This file was generated by ge.xml on May 11 2012 1:58:35am EDT.
+ This file was generated by ge.xml on May 11 2012 11:57:19pm EDT.
This file is automatically generated. Edit at your peril!
*/
@@ -72,6 +72,9 @@ type QueryVersionCookie struct {
// QueryVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie {
+ if _, ok := c.Extensions["GENERIC EVENT EXTENSION"]; !ok {
+ panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'Generic Event Extension'. ge.Init(connObj) must be called first.")
+ }
cookie := c.NewCookie(true, true)
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return QueryVersionCookie{cookie}
@@ -80,6 +83,9 @@ func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uin
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie {
+ if _, ok := c.Extensions["GENERIC EVENT EXTENSION"]; !ok {
+ panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'Generic Event Extension'. ge.Init(connObj) must be called first.")
+ }
cookie := c.NewCookie(false, true)
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return QueryVersionCookie{cookie}