diff --git a/httpstan/services_stub.py b/httpstan/services_stub.py index 1dfd1c5cc..d7986b1ff 100644 --- a/httpstan/services_stub.py +++ b/httpstan/services_stub.py @@ -157,28 +157,28 @@ async def call( fh.close() httpstan.cache.dump_fit(b"".join(compressed_parts), fit_name) - # if an exception has already occurred, grab relevant info messages, add as context + # if an exception has already occurred, grab relevant error messages, add as context exception = future.exception() if exception and len(exception.args) == 1: import gzip import json original_exception_message = exception.args[0] # e.g., from ValueError("Initialization failed.") - info_messages_for_context = [] + error_messages_for_context = [] num_context_messages = 4 jsonlines = gzip.decompress(b"".join(compressed_parts)).decode() for line in jsonlines.split("\n")[:num_context_messages]: try: message = json.loads(line) - info_message = message["values"].pop().replace("info:", "") - info_messages_for_context.append(info_message.strip()) + error_message = message["values"].pop().replace("error:", "") + error_messages_for_context.append(error_message.strip()) except json.JSONDecodeError: pass - # add the info messages to the original exception message. For example, + # add the error messages to the original exception message. For example, # ValueError("Initialization failed.") -> ValueError("Initialization failed. Rejecting initial value: Log probability ...") - if info_messages_for_context: - new_exception_message = f"{original_exception_message} {' '.join(info_messages_for_context)} ..." + if error_messages_for_context: + new_exception_message = f"{original_exception_message} {' '.join(error_messages_for_context)} ..." exception.args = (new_exception_message,) # `result()` method will raise exceptions, if any