Skip to content

Commit d978b4d

Browse files
Add python error handler
Summary: Adding an error handler for python. Including the 3 errors with the most questions asked in support groups for now. Will add links with 'how to resolve' later, but categorizing them so we can easily track it for now. Reviewed By: IanChilds Differential Revision: D71372593 fbshipit-source-id: 23fc1c837f9d5276afd16b50c82cc43029286178
1 parent 22399ee commit d978b4d

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

prelude/python/linking/native.bzl

+1
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ def process_native_linking(ctx, deps, python_toolchain, extra, package_style, al
327327
lang_preprocessor_flags = ctx.attrs.lang_preprocessor_flags,
328328
platform_preprocessor_flags = ctx.attrs.platform_preprocessor_flags,
329329
lang_platform_preprocessor_flags = ctx.attrs.lang_platform_preprocessor_flags,
330+
error_handler = python_toolchain.python_error_handler,
330331
)
331332

332333
executable_info = cxx_executable(ctx, impl_params)

prelude/python/make_py_package.bzl

+1
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ def _make_py_package_impl(
389389
category = "par",
390390
identifier = identifier_prefix.format(output_suffix),
391391
allow_cache_upload = allow_cache_upload,
392+
error_handler = python_toolchain.python_error_handler,
392393
)
393394

394395
else:

prelude/python/source_db.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def create_dbg_source_db(
4949
))
5050

5151
artifacts.append(dep_manifests.project_as_args("source_artifacts"))
52-
ctx.actions.run(cmd, category = "py_dbg_source_db")
52+
ctx.actions.run(cmd, category = "py_dbg_source_db", error_handler = python_toolchain.python_error_handler)
5353

5454
return DefaultInfo(default_output = output, other_outputs = artifacts)
5555

prelude/python/toolchain.bzl

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ PythonToolchainInfo = provider(
8383
"main_runner": provider_field(str, default = "__par__.bootstrap.run_as_main"),
8484
# Prefix to use when running a Python test/executable.
8585
"run_prefix": provider_field(list[typing.Any], default = []),
86+
"python_error_handler": provider_field(typing.Any, default = None),
8687
},
8788
)
8889

0 commit comments

Comments
 (0)