Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

- Fixed admin toast leaking a raw `SyntaxError: Unexpected token '<'` when an upload was rejected
upstream (e.g. nginx 413); the toast now shows `HTTP <status>` instead.
- Made the media upload max size configurable via the new `MEDIA_MAX_UPLOAD_SIZE_MB` env var.
- Fixed playlist share-target dropdown silently truncating to 30 tenants; it now loads every page.
- Refactored InteractiveController to use a typed `InteractiveSlideActionInput` DTO; regenerated API spec and RTK types.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,19 @@ export function displayError(errorString, error) {
if (error && error["hydra:description"]) {
errorText = error["hydra:description"];
}
if (error && error.data) {
errorText = error.data["hydra:description"] || error.data.message;
if (error?.data && typeof error.data === "object") {
errorText = error.data["hydra:description"] || error.data.message || "";
}
if (error && error.error) {
// RTK Query couldn't JSON-parse the response — typically an HTML error page
// from nginx/php-fpm rejecting the request before Symfony (e.g. 413 when the
// upload exceeds the proxy body-size limit). Show the HTTP status instead
// of leaking the "Unexpected token '<'" SyntaxError to the user.
if (!errorText && error?.status === "PARSING_ERROR") {
errorText = error.originalStatus
? `HTTP ${error.originalStatus}`
: "Server returned an unexpected response";
}
if (!errorText && error?.error) {
errorText = error.error;
}

Expand Down