aboutsummaryrefslogtreecommitdiff
path: root/nexgb/xgbgen/go_error.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-10 12:47:19 -0400
committerAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-10 12:47:19 -0400
commite239bb3c68a4981a3916534203c2fbd6b96f593c (patch)
treeebb9b1a4a4659d09edaf57ec39a744ff4bc15ff0 /nexgb/xgbgen/go_error.go
parent00c6217ca905b08ce0acda9a90492b5c1dc358e8 (diff)
downloadhaven-e239bb3c68a4981a3916534203c2fbd6b96f593c.tar.gz
haven-e239bb3c68a4981a3916534203c2fbd6b96f593c.tar.xz
haven-e239bb3c68a4981a3916534203c2fbd6b96f593c.zip
make resource ids their own individual types. last commit before overhaul to sub-packages
Diffstat (limited to 'nexgb/xgbgen/go_error.go')
-rw-r--r--nexgb/xgbgen/go_error.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go
index c96866c..f4577ef 100644
--- a/nexgb/xgbgen/go_error.go
+++ b/nexgb/xgbgen/go_error.go
@@ -68,9 +68,9 @@ func (e *Error) ImplementsError(c *Context) {
c.Putln("return err.Sequence")
c.Putln("}")
c.Putln("")
- c.Putln("func (err %s) BadId() Id {", e.ErrType())
+ c.Putln("func (err %s) BadId() uint32 {", e.ErrType())
if !c.protocol.isExt() {
- c.Putln("return Id(err.BadValue)")
+ c.Putln("return err.BadValue")
} else {
c.Putln("return 0")
}
@@ -128,8 +128,12 @@ func (e *ErrorCopy) ImplementsError(c *Context) {
c.Putln("return err.Sequence")
c.Putln("}")
c.Putln("")
- c.Putln("func (err %s) BadId() Id {", e.ErrType())
- c.Putln("return Id(err.BadValue)")
+ c.Putln("func (err %s) BadId() uint32 {", e.ErrType())
+ if !c.protocol.isExt() {
+ c.Putln("return err.BadValue")
+ } else {
+ c.Putln("return 0")
+ }
c.Putln("}")
c.Putln("")
c.Putln("func (err %s) Error() string {", e.ErrType())