-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
fix(files): more conversion tests and translate error messages #50240
Conversation
skjnldsv
commented
Jan 17, 2025
•
edited
Loading
edited
- Translate displayed error messages
- Prevent wrong extension
- Reorder destination sanity checks
- Add more integration tests
Signed-off-by: skjnldsv <[email protected]>
a49a773
to
abd3cb6
Compare
@@ -72,14 +76,18 @@ public function convert(int $fileId, string $targetMimeType, ?string $destinatio | |||
} | |||
|
|||
if (!$userFolder->get($parentDir)->isCreatable()) { | |||
throw new OCSForbiddenException(); | |||
throw new OCSForbiddenException($this->l10n->t('You do not have permission to create a file at the specified location')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this shown on the frontend? If not then it makes no sense to translate if it is only for developers (also makes debugging harder)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is shown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly not a HintException 😔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition.
But regarding the errors: If they are not shown to the end user then do not translate them. It makes debugging of logs much harder (we had this discussion in other places recently).
Co-authored-by: Ferdinand Thiessen <[email protected]> Signed-off-by: John Molakvoæ <[email protected]>