diff options
| author | Andrew Gallant (Ocelot) <[email protected]> | 2012-05-11 23:58:52 -0400 |
|---|---|---|
| committer | Andrew Gallant (Ocelot) <[email protected]> | 2012-05-11 23:58:52 -0400 |
| commit | d3b0a6b2da335ee0f2d4e4b01d708d73ea373f2c (patch) | |
| tree | d2bdecbb93439996f4249d6b317527e91bbffd4c /ge | |
| parent | e7773ad874c829516a786cbd91ed3fdd9a86e48d (diff) | |
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 'ge')
| -rw-r--r-- | ge/ge.go | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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} |
