You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a tool fails, attempt to show lines that contain error information (#152)
Before this change, when there's an error with a tool it's unclear why
it's happening. Users must know to re-run with "--verbose" option to see
the error text.
After this change, here's what the output looks like when there's an
error in MakeAppx:
```
PS D:\temp\rigvgl1m.zgh> winapp.exe pack .
[ERROR] - MakeAppx : error: Error info: error C00CE169: App manifest validation error: The app manifest must be valid as per schema: Line 38, Column 7, Reason: 'InvalidValue' violates enumeration constraint of 'appContainer mediumIL'.
[ERROR] - The attribute '{http://schemas.microsoft.com/appx/manifest/uap/windows10/10}TrustLevel' with value 'InvalidValue' failed to parse.
[ERROR] - MakeAppx : error: Package creation failed.
[ERROR] - MakeAppx : error: 0x80080204 - The specified package format is not valid: The package manifest is not valid.
[ERROR] - makeappx.exe reported an error. The above text is only part of the tool output. Please re-run with --verbose to see the full output.
❌ Failed to create MSIX package: Failed to create MSIX package: makeappx.exe execution failed with exit code 1
```
Here's what it looks like when there's an error in MakePri:
```
PS D:\temp\rigvgl1m.zgh> winapp.exe pack .
[ERROR] - ERROR: PRI191: 0x80004005 - Appx manifest not found or is invalid. Please ensure well-formed manifest file is present. Or specify an index name with /in switch.
End tag 'InvalidEndTag' does not match the start tag 'InvalidTag'.
[ERROR] - makepri.exe reported an error. The above text is only part of the tool output. Please re-run with --verbose to see the full output.
❌ Failed to create MSIX package: Failed to create MSIX package: Failed to generate PRI file: makepri.exe execution failed with exit code -2147467259
```
---------
Co-authored-by: Nikola Metulev <[email protected]>
Co-authored-by: Alexandre Zollinger Chohfi <[email protected]>
// Example makeappx.exe error output -- this goes to stdout:
21
+
// Processing "\\?\D:\temp\rigvgl1m.zgh\priconfig.xml" as a payload file. Its path in the package will be "priconfig.xml".
22
+
// Processing "\\?\D:\temp\rigvgl1m.zgh\resources.pri" as a payload file. Its path in the package will be "resources.pri".
23
+
// MakeAppx : error: Error info: error C00CE169: App manifest validation error: The app manifest must be valid as per schema: Line 38, Column 7, Reason: 'InvalidValue' violates enumeration constraint of 'appContainer mediumIL'.
24
+
// The attribute '{http://schemas.microsoft.com/appx/manifest/uap/windows10/10}TrustLevel' with value 'InvalidValue' failed to parse.
25
+
26
+
// MakeAppx : error: Package creation failed.
27
+
// MakeAppx : error: 0x80080204 - The specified package format is not valid: The package manifest is not valid.
28
+
29
+
// Now, find the first error line in stdout and print out the rest of the output from there.
logger.LogError("{ExeName} reported an error. The above text is only part of the tool output. Please re-run with --verbose to see the full output.",ExecutableName);
53
+
return;
54
+
}
55
+
}
56
+
57
+
// If no error pattern found or stderr has content, use default behavior
58
+
if(!string.IsNullOrWhiteSpace(stderr))
59
+
{
60
+
logger.LogError("{Stderr}",stderr);
61
+
logger.LogError("{ExeName} reported an error. The above text is only part of the tool output. Please re-run with --verbose to see the full output.",ExecutableName);
// makepri.exe writes errors to stderr, so just print stderr if there is any.
22
+
if(string.IsNullOrWhiteSpace(stderr))
23
+
{
24
+
base.PrintErrorText(stdout,stderr,logger);
25
+
}
26
+
else
27
+
{
28
+
logger.LogError("{Stderr}",stderr);
29
+
logger.LogError("{ExeName} reported an error. The above text is only part of the tool output. Please re-run with --verbose to see the full output.",ExecutableName);
0 commit comments