aboutsummaryrefslogtreecommitdiff
path: root/nexgb/xgbgen
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-11 01:58:52 -0400
committerAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-11 01:58:52 -0400
commit3e6b3544934cb71e3a3b0edf9bc184241ac1ad7f (patch)
treec9f52fa078fc860d7327e7a8441b2b7bc07f7cce /nexgb/xgbgen
parentc00652934e4ec68016a152b9bea10273b0be8726 (diff)
downloadhaven-3e6b3544934cb71e3a3b0edf9bc184241ac1ad7f.tar.gz
haven-3e6b3544934cb71e3a3b0edf9bc184241ac1ad7f.tar.xz
haven-3e6b3544934cb71e3a3b0edf9bc184241ac1ad7f.zip
add a little more docs for errors
Diffstat (limited to 'nexgb/xgbgen')
-rw-r--r--nexgb/xgbgen/go_error.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go
index 81a017b..55fd28b 100644
--- a/nexgb/xgbgen/go_error.go
+++ b/nexgb/xgbgen/go_error.go
@@ -68,6 +68,8 @@ func (e *Error) ImplementsError(c *Context) {
c.Putln("return err.Sequence")
c.Putln("}")
c.Putln("")
+ c.Putln("// BadId returns the 'BadValue' number if one exists for the "+
+ "%s error. If no bad value exists, 0 is returned.", e.ErrConst())
c.Putln("func (err %s) BadId() uint32 {", e.ErrType())
if !c.protocol.isExt() {
c.Putln("return err.BadValue")
@@ -75,6 +77,8 @@ func (e *Error) ImplementsError(c *Context) {
c.Putln("return 0")
}
c.Putln("}")
+ c.Putln("// Error returns a rudimentary string representation of the %s "+
+ "error.", e.ErrConst())
c.Putln("")
c.Putln("func (err %s) Error() string {", e.ErrType())
ErrorFieldString(c, e.Fields, e.ErrConst())
@@ -130,6 +134,8 @@ func (e *ErrorCopy) ImplementsError(c *Context) {
c.Putln("return err.Sequence")
c.Putln("}")
c.Putln("")
+ c.Putln("// BadId returns the 'BadValue' number if one exists for the "+
+ "%s error. If no bad value exists, 0 is returned.", e.ErrConst())
c.Putln("func (err %s) BadId() uint32 {", e.ErrType())
if !c.protocol.isExt() {
c.Putln("return err.BadValue")
@@ -138,6 +144,8 @@ func (e *ErrorCopy) ImplementsError(c *Context) {
}
c.Putln("}")
c.Putln("")
+ c.Putln("// Error returns a rudimentary string representation of the %s "+
+ "error.", e.ErrConst())
c.Putln("func (err %s) Error() string {", e.ErrType())
ErrorFieldString(c, e.Old.(*Error).Fields, e.ErrConst())
c.Putln("}")