Re-order built-in status codes

This commit is contained in:
Nigel Tao committed 2018-06-10 22:08:44 +10:00
1 parent 50a955317a
commit 3ece6e0f1d
16 files changed
+72 -68

No files matched your search

+11 -7
View File
@@ -37,22 +37,26 @@ func (z Status) String() string {
}
var StatusList = [...]Status{
// TODO: sort these somehow, when the list has stabilized?
{0, 0x00, "ok"},
{t.IDError, -0x01, "bad wuffs version"},
{t.IDError, -0x02, "bad sizeof receiver"},
{t.IDError, -0x03, "bad receiver"},
{t.IDError, -0x04, "bad argument"},
{t.IDError, -0x10, "check_wuffs_version not called"},
{t.IDError, -0x11, "check_wuffs_version called twice"},
{t.IDError, -0x30, "invalid I/O operation"},
{t.IDError, -0x40, "closed for writes"}, // TODO: is this unused? Should callee or caller check closed-ness?
{t.IDError, -0x31, "unexpected EOF"}, // Used if reading when closed == true.
{t.IDSuspension, +0x02, "short read"}, // Used if reading when closed == false.
{t.IDSuspension, +0x03, "short write"},
{t.IDError, -0x20, "cannot return a suspension"},
{t.IDError, -0x12, "invalid call sequence"},
{t.IDError, -0x20, "cannot return a suspension"},
{t.IDError, -0x30, "invalid I/O operation"},
{t.IDError, -0x31, "unexpected EOF"}, // Used if reading when closed == true.
{t.IDError, -0x32, "closed for writes"}, // TODO: is this unused? Should callee or caller check closed-ness?
{t.IDSuspension, +0x01, "end of data"},
{t.IDSuspension, +0x02, "short read"}, // Used if reading when closed == false.
{t.IDSuspension, +0x03, "short write"},
}
var StatusMap = map[string]Status{}