fix: format docker-compose error objects as readable messages#204
fix: format docker-compose error objects as readable messages#204
Conversation
You're right! I've moved the error formatting logic to the Changes in commit c20b3ae:
The error messages remain user-friendly, but the responsibility now correctly belongs to the service layer. |
fd08507 to
155ecb5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #204 +/- ##
==========================================
+ Coverage 97.02% 97.38% +0.35%
==========================================
Files 9 9
Lines 168 191 +23
Branches 22 29 +7
==========================================
+ Hits 163 186 +23
Misses 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
155ecb5 to
14f0ae2
Compare
Co-authored-by: neilime <314088+neilime@users.noreply.github.com> Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
14f0ae2 to
dc56a16
Compare
When docker-compose commands fail, the library rejects with
{ exitCode, err, out }objects. These were being JSON stringified into GitHub Actions error output, producing incomplete, unreadable messages like:Changes
src/services/docker-compose.service.ts: Added error handling inup()anddown()methods to catch docker-compose library errors and throw proper Error objects with formatted, readable messagesDockerComposeServicefor better separation of concernsResult
Errors now display as:
The service-level error handler formats standard Error objects (passes them through), docker-compose results (formats with exit code and context), and falls back to JSON.stringify for unknown types. Deduplicates stderr/stdout when identical and trims whitespace.
Architecture
Error formatting is handled at the service layer where docker-compose errors originate, rather than at the runner level. This provides better separation of concerns and ensures errors are thrown as proper Error instances from the source.
Original prompt
This section details on the original issue you should resolve
<issue_title>The erroneous output is unfriendly, and the cause of the error cannot be found.</issue_title>
<issue_description>An error occurred in the workflow, but the output error log format is json and it is incomplete, making it impossible to determine the cause of the error.
Link: https://github.com/swoole/library/actions/runs/19858334945/job/56901793149</issue_description>
Comments on the Issue (you are @copilot in this section)
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.