diff --git a/ui/src/library/DeleteLibraryButton.jsx b/ui/src/library/DeleteLibraryButton.jsx
index b9e8f1eb1..6cdb1937b 100644
--- a/ui/src/library/DeleteLibraryButton.jsx
+++ b/ui/src/library/DeleteLibraryButton.jsx
@@ -51,4 +51,4 @@ const DeleteLibraryButton = ({ record, resource, basePath, ...props }) => {
)
}
-export default DeleteLibraryButton
\ No newline at end of file
+export default DeleteLibraryButton
diff --git a/ui/src/library/LibraryCreate.jsx b/ui/src/library/LibraryCreate.jsx
index 16c447280..eb4358b72 100644
--- a/ui/src/library/LibraryCreate.jsx
+++ b/ui/src/library/LibraryCreate.jsx
@@ -41,11 +41,11 @@ const LibraryCreate = (props) => {
if (error.body && error.body.errors) {
return error.body.errors
}
-
+
// Handle other structured errors from the server
if (error.body && error.body.error) {
const errorMsg = error.body.error
-
+
// Handle database constraint violations
if (errorMsg.includes('UNIQUE constraint failed: library.name')) {
return { name: 'ra.validation.unique' }
@@ -53,14 +53,15 @@ const LibraryCreate = (props) => {
if (errorMsg.includes('UNIQUE constraint failed: library.path')) {
return { path: 'ra.validation.unique' }
}
-
+
// Show a general notification for other server errors
notify(errorMsg, 'error')
return
}
-
+
// Fallback for unexpected error formats
- const fallbackMessage = error.message ||
+ const fallbackMessage =
+ error.message ||
(typeof error === 'string' ? error : 'An unexpected error occurred')
notify(fallbackMessage, 'error')
}
@@ -78,4 +79,4 @@ const LibraryCreate = (props) => {
)
}
-export default LibraryCreate
\ No newline at end of file
+export default LibraryCreate
diff --git a/ui/src/library/LibraryEdit.jsx b/ui/src/library/LibraryEdit.jsx
index 5562ccc88..da46a73ab 100644
--- a/ui/src/library/LibraryEdit.jsx
+++ b/ui/src/library/LibraryEdit.jsx
@@ -119,12 +119,11 @@ const LibraryEdit = (props) => {
fullWidth
disabled={isFirstLibrary}
/>
-