fix(16-01): add S3 404 error handling with toast notification

- Add react-toastify import for toast notifications
- Show toast.error('File no longer available') when attachment fetch fails
- Handles S3 404 errors gracefully per REQ-5.5
- Replaces silent failure with user-friendly error message
This commit is contained in:
Nuwan 2026-02-06 18:44:14 +05:30
parent 744c735817
commit 1d026c3d30
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import React, { useCallback, useState } from 'react';
import PropTypes from 'prop-types';
import { toast } from 'react-toastify';
import { formatTimestamp } from '../../../utils/formatTimestamp';
import { formatFileSize } from '../../../services/attachmentValidation';
import { getMusicNotationUrl } from '../../../helpers/rest';
@ -63,7 +64,8 @@ const JKChatMessage = ({ message }) => {
}
} catch (error) {
console.error('Failed to fetch attachment URL:', error);
// Could show toast error here, but keep it simple for now
// Show user-friendly error (REQ-5.5)
toast.error('File no longer available');
} finally {
setIsLoadingUrl(false);
}