Merged
Conversation
80f053a to
5ddc520
Compare
come-nc
reviewed
Jan 28, 2025
| try { | ||
| $this->emit('exception', [$e]); | ||
| } catch (\Exception $ignore) { | ||
| $e = new TypeError('A type error occurred. For more details, please refer to the logs, which provide additional context about the type error.'); |
Contributor
There was a problem hiding this comment.
Suggested change
| $e = new TypeError('A type error occurred. For more details, please refer to the logs, which provide additional context about the type error.'); | |
| $e = new TypeError('A type error occurred. For more details, please refer to the logs, which provide additional context about the type error.', 0, $e); |
Would it be a problem to store the previous exception? It seems it’s only part of the response in debug mode.
Contributor
Author
There was a problem hiding this comment.
Good question 👍
The debugExceptions blocks appear to be dead code because there's no code in server setting it to true. Sounds like a nice enhancement to also include a stack trace, when debug enabled, for dav requests.
For non-dav requests we already include the stack trace with debug true.
susnux
reviewed
Jan 31, 2025
| if ($e instanceof \TypeError) { | ||
| try { | ||
| $this->emit('exception', [$e]); | ||
| } catch (\Exception $ignore) { |
Contributor
There was a problem hiding this comment.
Suggested change
| } catch (\Exception $ignore) { | |
| } catch (\Exception) { |
5ddc520 to
93047d3
Compare
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
93047d3 to
4978cd3
Compare
Contributor
Author
|
/backport to stable31 |
ChristophWurst
approved these changes
Feb 11, 2025
susnux
approved these changes
Feb 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up for #49004
Alternative to #49960
Summary
Rethrowing may trigger a weird code path in remote.php1 and therefore it's better to replace the type error with a generic one. The actual expection is still logged.
Test cases for manual testing:
TODO
Checklist
Footnotes
https://github.com/nextcloud/server/blob/2c773033bcf44268cad1e427fffdb9bbcc6a0327/remote.php#L27-L29 ↩