Studio: Improve context for errors that bubble up from wordpress-server-child - #3477
Conversation
📊 Performance Test ResultsComparing bfc9ba3 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
…Automattic/studio into add/make-child-process-errors-bubble-up
…Automattic/studio into add/make-child-process-errors-bubble-up
…ild-process-errors-bubble-up
| const logsDir = nodePath.join( PROCESS_MANAGER_HOME, 'logs' ); | ||
| const stdoutPath = nodePath.join( logsDir, `studio-site-${ siteId }-out.log` ); | ||
| const stderrPath = nodePath.join( logsDir, `studio-site-${ siteId }-error.log` ); | ||
| const dateTag = new Date().toISOString().slice( 0, 10 ).replace( /-/g, '' ); |
There was a problem hiding this comment.
This can hit timezone issues, the tag here is UTC but the daemon writes the filename in local time, so the file won’t be found. I’d suggest looking up the most recent studio-site-${ siteId } log files instead.
There was a problem hiding this comment.
I implemented this suggestion in 8b04b28
There was a problem hiding this comment.
While testing with another Blueprint, I noticed the new error parsing can show misleading errors to users.
The dialog trims the message at the first ., so URLs/domains get cut off. In this case the real URL is:
https://example.com/missing-plugin.zip
But the dialog only shows it up to https://example.:
This seems to come from simplifyErrorToFirstSentence() treating any . as a sentence boundary.
Test Blueprint:
{
"meta": {
"title": "Broken URL Test Blueprint",
"author": "Studio test",
"description": "Intentionally fails while fetching a plugin ZIP from a broken URL."
},
"preferredVersions": {
"php": "8.3",
"wp": "latest"
},
"steps": [
{
"step": "installPlugin",
"pluginData": {
"resource": "url",
"url": "https://example.com/missing-plugin.zip"
}
}
]
}|
Thanks for the review @bcotrim ! I will take a look: I initially went with shortening because in some cases the errors were too long and too confusing to read 🙈 |
…Automattic/studio into add/make-child-process-errors-bubble-up
bcotrim
left a comment
There was a problem hiding this comment.
LGTM 👍
Nice solution @katinthehatsite, thanks for making the changes
![]() |
![]() |
|---|



Related issues
Fixes STU-1496
How AI was used in this PR
It was used to help identify the issue.
Proposed Changes
This PR ensures that we display more detailed error message to the user from
wordpress-server-childTesting Instructions
npm startbroken-blueprint.json
Add site -> Build a new site -> Upload blueprintPre-merge Checklist