1-index error messages printed to the console (#1709)

The `range` operator  returns array indexes that are 0-indexed. This is helpful when working with the computer code, but since we print the error to humans it looks really strange.

e.g. 
```
error: 7 errors occurred:
    0) resource 'urn:pulumi:timer-ex::timer::pulumi:pulumi:Stack::timer-timer-ex' is from a different stack (timer-ex != timer-import)
    1) resource 'urn:pulumi:timer-ex::timer:☁️timer:Timer::test-timer' is from a different stack (timer-ex != timer-import)
    ...
```
This commit is contained in:
Chris Smith 2018-08-06 11:58:06 -07:00 committed by GitHub
parent 0614b1d052
commit 8de307b876
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -135,7 +135,7 @@ func errorMessage(err error) string {
}
msg := fmt.Sprintf("%d errors occurred:", len(wr))
for i, werr := range wr {
msg += fmt.Sprintf("\n %d) %s", i, errorMessage(werr))
msg += fmt.Sprintf("\n %d) %s", i+1, errorMessage(werr))
}
return msg
}