server icon indicating copy to clipboard operation
server copied to clipboard

Do not stop at the first PHP error/warning in files:scan

Open come-nc opened this issue 2 years ago • 6 comments

  • Resolves: #35931

Summary

The files:scan command sets a custom error handler to show PHP errors. But it stops at the first one, failing the whole scan for one malformed PNG file. This PR changes that to instead show errors but continue.

Output: Screenshot_20230427_104813

Checklist

come-nc avatar Apr 27 '23 08:04 come-nc

Is the full stack trace needed on screen? Could it be logged (on file) and instead just display the exeption message?

solracsf avatar Apr 27 '23 14:04 solracsf

Is the full stack trace needed on screen? Could it be logged (on file) and instead just display the exeption message?

The full stack trace was there on screen already, I did not change that. But I now changed it so that the stacktrace only shows in very verbose mode, it makes more sense :+1:

come-nc avatar May 02 '23 08:05 come-nc

/backport to stable26

szaimen avatar May 02 '23 08:05 szaimen

/backport to stable25

szaimen avatar May 02 '23 08:05 szaimen

~~Putting the full exception trace in the output isn't great imo. Probably better to only show the message in the output and log the rest.~~

Edit: missed the previous discussion

Additionally, summarizing the number of failures somewhere at the end would prevent errors from being unseen from scrolling of the screen with large verbose outputs.

icewind1991 avatar May 02 '23 14:05 icewind1991

Additionally, summarizing the number of failures somewhere at the end would prevent errors from being unseen from scrolling of the screen with large verbose outputs.

Added an error counter.

come-nc avatar May 04 '23 15:05 come-nc

The backport to stable25 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable25
git pull origin/stable25

# Create the new backport branch
git checkout -b fix/foo-stable25

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport