service: change constant errors

This commit:

  * moves defined errors to a separate file;

  * renames ErrEmptyToken to ErrNilToken;

  * merges ErrZeroTTL and ErrIncorrectTTL into single ErrInvalidTTL.
This commit is contained in:
Leonard Lyubich 2020-05-04 13:04:10 +03:00
parent e3cab218dc
commit fc177c4ce3
6 changed files with 31 additions and 37 deletions

View file

@ -26,13 +26,13 @@ func TestMetaRequest(t *testing.T) {
},
{
code: codes.InvalidArgument,
msg: ErrIncorrectTTL.Error(),
msg: ErrInvalidTTL.Error(),
name: "direct to storage node",
handler: IRNonForwarding(StorageNode),
RequestMetaHeader: RequestMetaHeader{TTL: NonForwardingTTL},
},
{
msg: ErrZeroTTL.Error(),
msg: ErrInvalidTTL.Error(),
code: codes.InvalidArgument,
name: "zero ttl",
handler: IRNonForwarding(StorageNode),