@@ -165,6 +165,9 @@ function handleProgress(task_id, fileName, season) {
165165 canSubmit = false ;
166166 localStorage . setItem ( STORAGE_KEY , task_id ) ;
167167 setDropZoneState ( "uploading" ) ;
168+ const errBox = document . getElementById ( "upload-error-box" ) ;
169+ if ( errBox ) errBox . style . display = "none" ;
170+ document . getElementById ( "progress-bar" ) . style . background = "" ;
168171
169172 // Show safe-to-close banner immediately
170173 if ( fileName || season ) showSafeToCloseBanner ( fileName , season ) ;
@@ -194,9 +197,24 @@ function handleProgress(task_id, fileName, season) {
194197 localStorage . removeItem ( STORAGE_KEY ) ;
195198 hideSafeToCloseBanner ( ) ;
196199
197- document . getElementById ( "progress-bar_pct" ) . innerText = "Done ✓" ;
198- document . getElementById ( "progress-bar_count" ) . innerText =
199- data . total ? `${ data . total . toLocaleString ( ) } rows written` : "Complete" ;
200+ if ( data . error ) {
201+ document . getElementById ( "progress-bar_pct" ) . innerText = "Failed ✗" ;
202+ document . getElementById ( "progress-bar" ) . style . background = "#b91c1c" ;
203+ document . getElementById ( "progress-bar_count" ) . innerText = "" ;
204+ const errBox = document . getElementById ( "upload-error-box" ) || ( ( ) => {
205+ const el = document . createElement ( "div" ) ;
206+ el . id = "upload-error-box" ;
207+ el . style . cssText = "margin-top:10px;padding:10px 14px;background:#450a0a;border:1px solid #b91c1c;border-radius:6px;color:#fca5a5;font-size:0.85em;white-space:pre-wrap;word-break:break-word;" ;
208+ document . querySelector ( ".progress-bar_parent" ) . after ( el ) ;
209+ return el ;
210+ } ) ( ) ;
211+ errBox . innerText = "❌ Upload failed:\n" + data . error ;
212+ errBox . style . display = "block" ;
213+ } else {
214+ document . getElementById ( "progress-bar_pct" ) . innerText = "Done ✓" ;
215+ document . getElementById ( "progress-bar_count" ) . innerText =
216+ data . total ? `${ data . total . toLocaleString ( ) } rows written` : "Complete" ;
217+ }
200218
201219 [ "drop_zone-input" , "season-select" , "dbc-select" , "dbc-input" ] . forEach ( ( id ) => {
202220 const el = document . getElementById ( id ) ;
0 commit comments