ref: 65b7d4221b90445bfc089873092411cf7e322933
parent: 0e75af74db30259ec355a7b79a1e257d5fe00eef
author: Baibhav Vatsa <baibhavvatsa@gmail.com>
date: Fri Oct 11 09:51:24 EDT 2019
tpl: Modify error messages of after, first, and last Modified the messages functions after, first, and last threw on being passed invalid parameters (index or limit) to be more standardised and resemble what Go compiler would throw. Fixes #6415
--- a/tpl/collections/collections.go
+++ b/tpl/collections/collections.go
@@ -61,7 +61,7 @@
}
if indexv < 0 {
- return nil, errors.New("can't return negative/empty count of items from sequence")
+ return nil, errors.New("sequence bounds out of range [" + cast.ToString(indexv) + ":]")
}
seqv := reflect.ValueOf(seq)
@@ -219,7 +219,7 @@
}
if limitv < 0 {
- return nil, errors.New("can't return negative count of items from sequence")
+ return nil, errors.New("sequence length must be non-negative")
}
seqv := reflect.ValueOf(seq)
@@ -379,7 +379,7 @@
}
if limitv < 0 {
- return nil, errors.New("can't return negative/empty count of items from sequence")
+ return nil, errors.New("sequence length must be non-negative")
}
seqv := reflect.ValueOf(seq)