MCPcopy
hub / github.com/pex-tool/pex / reportable_unexpected_error_msg

Function reportable_unexpected_error_msg

pex/exceptions.py:47–73  ·  view source on GitHub ↗
(
    msg="",  # type: str
    *args,  # type: Any
    **kwargs  # type: Any
)

Source from the content-addressed store, hash-verified

45
46
47def reportable_unexpected_error_msg(
48 msg="", # type: str
49 *args, # type: Any
50 **kwargs # type: Any
51):
52 # type: (...) -> str
53
54 message = [msg.format(*args, **kwargs), "---", _ASSERT_DETAILS]
55 pex = os.environ.get("PEX")
56 if pex:
57 try:
58 import json
59
60 from pex.pex_info import PexInfo
61
62 pex_info = PexInfo.from_pex(pex)
63 pex_info.update(PexInfo.from_env())
64 pex_info_json = json.dumps(pex_info.as_json_dict(), indent=2)
65 except Exception:
66 pass
67 else:
68 message.append("PEX-INFO:")
69 message.append(pex_info_json)
70 message.append("---")
71 message.append(_ASSERT_ADVICE)
72
73 return "\n".join(message)
74
75
76def production_assert(

Callers 15

install_scriptsFunction · 0.90
create_whlFunction · 0.90
install_wheelFunction · 0.90
get_entry_mapMethod · 0.90
create_manifestsFunction · 0.90
resolve_run_specMethod · 0.90
__call__Method · 0.90
download_distributionsFunction · 0.90
currentMethod · 0.90
_marker_itemsFunction · 0.90
end_visit_groupMethod · 0.90
from_dictMethod · 0.90

Calls 7

from_pexMethod · 0.80
as_json_dictMethod · 0.80
appendMethod · 0.80
getMethod · 0.45
updateMethod · 0.45
from_envMethod · 0.45
joinMethod · 0.45

Tested by 1