@@ -345,42 +345,43 @@ def _wait_for_deployment(
345345 with toolkit .progress (
346346 next (messages ), inline_logs = True , lines_to_show = 20
347347 ) as progress :
348- for line in _stream_build_logs (deployment .id ):
349- time_elapsed = time .monotonic () - started_at
348+ with handle_http_errors (progress = progress ):
349+ for line in _stream_build_logs (deployment .id ):
350+ time_elapsed = time .monotonic () - started_at
350351
351- data = json .loads (line )
352+ data = json .loads (line )
352353
353- if "message" in data :
354- progress .log (Text .from_ansi (data ["message" ].rstrip ()))
354+ if "message" in data :
355+ progress .log (Text .from_ansi (data ["message" ].rstrip ()))
355356
356- if data .get ("type" ) == "complete" :
357- progress .log ("" )
358- progress .log (
359- f"π Ready the chicken! Your app is ready at [link={ deployment .url } ]{ deployment .url } [/link]"
360- )
357+ if data .get ("type" ) == "complete" :
358+ progress .log ("" )
359+ progress .log (
360+ f"π Ready the chicken! Your app is ready at [link={ deployment .url } ]{ deployment .url } [/link]"
361+ )
361362
362- progress .log ("" )
363+ progress .log ("" )
363364
364- progress .log (
365- f"You can also check the app logs at [link={ deployment .dashboard_url } ]{ deployment .dashboard_url } [/link]"
366- )
365+ progress .log (
366+ f"You can also check the app logs at [link={ deployment .dashboard_url } ]{ deployment .dashboard_url } [/link]"
367+ )
367368
368- break
369+ break
369370
370- if data .get ("type" ) == "failed" :
371- progress .log ("" )
372- progress .log (
373- f"π Oh no! Something went wrong. Check out the logs at [link={ deployment .dashboard_url } ]{ deployment .dashboard_url } [/link]"
374- )
375- raise typer .Exit (1 )
371+ if data .get ("type" ) == "failed" :
372+ progress .log ("" )
373+ progress .log (
374+ f"π Oh no! Something went wrong. Check out the logs at [link={ deployment .dashboard_url } ]{ deployment .dashboard_url } [/link]"
375+ )
376+ raise typer .Exit (1 )
376377
377- if time_elapsed > 30 :
378- messages = cycle (LONG_WAIT_MESSAGES ) # pragma: no cover
378+ if time_elapsed > 30 :
379+ messages = cycle (LONG_WAIT_MESSAGES ) # pragma: no cover
379380
380- if (time .monotonic () - last_message_changed_at ) > 2 :
381- progress .title = next (messages ) # pragma: no cover
381+ if (time .monotonic () - last_message_changed_at ) > 2 :
382+ progress .title = next (messages ) # pragma: no cover
382383
383- last_message_changed_at = time .monotonic () # pragma: no cover
384+ last_message_changed_at = time .monotonic () # pragma: no cover
384385
385386
386387def _setup_environment_variables (toolkit : RichToolkit , app_id : str ) -> None :
0 commit comments