Skip to content

Commit

Permalink
Fix google#644: make string interpolation error msg clearer.
Browse files Browse the repository at this point in the history
  • Loading branch information
uberspot authored and sparkprime committed May 16, 2019
1 parent 0ecced5 commit 9ec37af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stdlib/std.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ limitations under the License.
local tmp = if code.fw == '*' then {
j: j + 1,
fw: if j >= std.length(arr) then
error 'Not enough values to format: ' + std.length(arr)
error ('Not enough values to format: ' + std.length(arr) + ', expected at least ' + j)
else
arr[j],
} else {
Expand All @@ -670,7 +670,7 @@ limitations under the License.
local tmp2 = if code.prec == '*' then {
j: tmp.j + 1,
prec: if tmp.j >= std.length(arr) then
error 'Not enough values to format: ' + std.length(arr)
error ('Not enough values to format: ' + std.length(arr) + ', expected at least ' + tmp.j)
else
arr[tmp.j],
} else {
Expand All @@ -682,7 +682,7 @@ limitations under the License.
if j2 < std.length(arr) then
arr[j2]
else
error 'Not enough values to format, got ' + std.length(arr);
error ('Not enough values to format: ' + std.length(arr) + ', expected at least ' + j2);
local s =
if code.ctype == '%' then
'%'
Expand Down

0 comments on commit 9ec37af

Please sign in to comment.