Fix invoke error reporting. (#3048)
- Report all failures - Use appropriate member functions to access failure details Fixes https://github.com/pulumi/pulumi-terraform/issues/396
This commit is contained in:
parent
154c1caa43
commit
3c03ee3bdd
|
@ -11,6 +11,9 @@ CHANGELOG
|
|||
- Fix a bug in the GitHub Actions program preventing errors from being rendered in the Actions log on github.com.
|
||||
[#3036](https://github.com/pulumi/pulumi/pull/3036)
|
||||
|
||||
- Fix a bug in the Node.JS SDK that caused failure details for provider functions to go unreported.
|
||||
[#3048](https://github.com/pulumi/pulumi/pull/3048)
|
||||
|
||||
## 0.17.28 (2019-08-05)
|
||||
|
||||
- Retry renaming a temporary folder during plugin installation
|
||||
|
|
|
@ -83,7 +83,14 @@ export async function invoke(tok: string, props: Inputs, opts?: InvokeOptions):
|
|||
// If there were failures, propagate them.
|
||||
const failures: any = resp.getFailuresList();
|
||||
if (failures && failures.length) {
|
||||
throw new Error(`Invoke of '${tok}' failed: ${failures[0].reason} (${failures[0].property})`);
|
||||
let reasons = "";
|
||||
for (let i = 0; i < failures.length; i++) {
|
||||
if (reasons !== "") {
|
||||
reasons += "; ";
|
||||
}
|
||||
reasons += `${failures[i].getReason()} (${failures[i].getProperty()})`;
|
||||
}
|
||||
throw new Error(`Invoke of '${tok}' failed: ${reasons}`);
|
||||
}
|
||||
|
||||
// Finally propagate any other properties that were given to us as outputs.
|
||||
|
|
Loading…
Reference in a new issue