veyron.io/wspr/veyron/services/wsprd: Convert to verror2.
This change uses verror2 as much as possible and verror as little as possible
in veyron.io/wspr/veyron/services/wsprd.
In various places I replaced verror uses with standard error codes but custom
messages with new verror2 custom error codes and equivalent messages.
In principal.go, in Principal(), I continued to use a standard error code (NoExist),
since the error message seemed appropriate ("Does not exist: <origin>").
I did not do the same with the "unknown account" error, which also
previously used NoExist, because that would leave clients unable to
distinguish between the two errors.
I added a routine to util_test.go to make it easier to get against error codes
rather than pattern patching on the string.
In util_test.go, the original verror is still in use in a minor way: verror2
reuses the type verror.ID, as this makes transition easier. It does not rename
the type because Go uses name equivalence. The use will become a verror2
ErrorID when verror is removed.
Change-Id: I7af2659e658fcb4d97c8ac178a122d533b4adee9
4 files changed
tree: ac65783b14239cd1a6b2c1e67070fc5e834f7481
- services/