Skip to content
Snippets Groups Projects

pmb.helpers.repo.download: proper error for 404

Merged Oliver Smith requested to merge ollieparanoid/pmbootstrap:download-proper-error-msg into master
  1. Oct 27, 2024
    • Oliver Smith's avatar
      pmb.helpers.repo.download: proper error for 404 (MR 2462) · 7269d05b
      Oliver Smith authored
      Flush the progress bar displayed by the function before logging a
      warning message for 404 not found responses from the server. Without
      flushing, this message gets lost.
      
      In addition to the warning, display a NOTE and ERROR at the end to
      explain what went wrong:
      
        [20:16:50] Update package index for x86_64 (4 file(s))
        [20:16:51] WARNING: file not found: http://mirror.postmarketos.org/postmarketos_get_404_test/edge/main/x86_64/APKINDEX.tar.gz
        [20:16:51] NOTE: check the [mirrors] section in 'pmbootstrap config'
        [20:16:51] ERROR: getting APKINDEX from binary package mirror failed!
      
      Without handling this properly, pmbootstrap would fail slightly later
      with a much less useful error:
      
        [15:14:28] ERROR: expected str, bytes or os.PathLike object, not NoneType
      
      Fixes: pmbootstrap issue 2424
      Unverified
      7269d05b
Loading