Make WordPress Core

Opened 2 months ago

Closed 2 months ago

Last modified 2 months ago

#62814 closed defect (bug) (fixed)

Hide the Node.js error message when a Docker command produces a non-zero exit code

Reported by: johnbillion's profile johnbillion Owned by: johnbillion's profile johnbillion
Milestone: 6.8 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

When running a command that goes via docker.js -- for example the PHP unit tests with npm run test:php or a WP-CLI command with npm run env:cli -- a rather verbose and unnecessary error message and stack trace will be shown by Node.js at the end of the output if the target command produces a non-zero exit code.

This can safely be hidden because the stack trace only points to the execSync() call and is of no use.

Let's hide it with a try catch block. The prior output from the target command remains visible.

Change History (3)

This ticket was mentioned in PR #8135 on WordPress/wordpress-develop by @johnbillion.


2 months ago
#1

  • Keywords has-patch added

Trac ticket: https://core.trac.wordpress.org/ticket/62814

## Screenshots

### Before

https://github.com/user-attachments/assets/f899e4a2-3cde-4366-afda-be32bc05bfb8

### After

https://github.com/user-attachments/assets/6768b087-9b56-4ea4-8026-226bc892828f

#2 @johnbillion
2 months ago

  • Owner set to johnbillion
  • Resolution set to fixed
  • Status changed from new to closed

In 59659:

Build/Test Tools: Hide the Node.js error message when a Docker command produces a non-zero exit code.

When running a command that goes via docker.js and produces a non-zero exit code, the error message and stack trace from node an safely be hidden because the stack trace only points to the execSync() call and is of no use.

Fixes #62814

Note: See TracTickets for help on using tickets.