Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Runner:run() more verbose in case of failure #218

Open
ocean90 opened this issue Jun 10, 2021 · 1 comment
Open

Make Runner:run() more verbose in case of failure #218

ocean90 opened this issue Jun 10, 2021 · 1 comment
Labels
[Component] CLI CLI commands and tooling [Type] Enhancement New functionality

Comments

@ocean90
Copy link
Member

ocean90 commented Jun 10, 2021

Issue Overview

❯ wp @translate traduttore project update 239
Warning: Could not update translations for project (ID: 239)!

It would be nice to display why exactly the translations could not be updated. The command uses Runner:run() which unfortunately only returns "True on success, false otherwise.".
In my case it was a stale lock so I was expecting that the warning would mention that.

I think Runner:run() should be updated to return a WP_Error object or throw an exception in case of failures.

@ocean90 ocean90 added [Type] Enhancement New functionality [Component] CLI CLI commands and tooling labels Jun 10, 2021
@ocean90 ocean90 added this to the Future Release milestone Jun 10, 2021
@swissspidy
Copy link
Collaborator

It's also impossible to tell whether the update failed at the POT generation or at the import stage in Updater::update().

Throwing exceptions throughout the codebase for failures like this, which could then be caught in ProjectCommand or earlier, would make this easier for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] CLI CLI commands and tooling [Type] Enhancement New functionality
Projects
None yet
Development

No branches or pull requests

2 participants