Skip to content

Commit

Permalink
Check that request is not None
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Huang authored and Nick Huang committed Oct 8, 2024
1 parent c0f3745 commit e6cbc10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/langsmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,9 +743,9 @@ def _content_above_size(self, content_length: Optional[int], request: Optional[r
return None
if content_length > size_limit:
should_debug_crash_dump = os.getenv("LANGSMITH_DEBUG_CRASH_DUMP") in ["1", "true"]
if should_debug_crash_dump:
if should_debug_crash_dump and request is not None:
with open("content_size_limit_crash_dump.jsonl", "a") as f:
json.dump(request.body, f)
json.dump(request, f)
f.write("\n")
return (
f"The content length of {content_length} bytes exceeds the "
Expand Down

0 comments on commit e6cbc10

Please sign in to comment.