1 diff --git a/piptools/scripts/compile.py b/piptools/scripts/compile.py
2 index 195faa7..3e69437 100755
3 --- a/piptools/scripts/compile.py
4 +++ b/piptools/scripts/compile.py
5 @@ -9,7 +9,7 @@ from pathlib import Path
6 from typing import IO, Any, BinaryIO, cast
9 -from build import BuildBackendException
10 +from build import BuildException
11 from click.utils import LazyFile, safecall
12 from pip._internal.req import InstallRequirement
13 from pip._internal.req.constructors import install_req_from_line
14 @@ -369,6 +369,6 @@ def cli(
15 isolated=build_isolation,
16 quiet=log.verbosity <= 0,
18 - except BuildBackendException as e:
19 + except (BuildException, StopIteration) as e:
21 log.error(f"Failed to parse {os.path.abspath(src_file)}")