Skip to content

Commit

Permalink
fix: remove response text when the HTML status code is an error (#213)
Browse files Browse the repository at this point in the history
* release: version 0.4.7

* remove response text from url error
  • Loading branch information
MthwRobinson authored Feb 10, 2023
1 parent f890972 commit 962de78
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.4.7-dev4
## 0.4.7

* Added the ability to pull an HTML document from a url in `partition_html`.
* Added the the ability to get file summary info from lists of filenames and lists
Expand Down
2 changes: 1 addition & 1 deletion unstructured/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.7-dev4" # pragma: no cover
__version__ = "0.4.7" # pragma: no cover
2 changes: 1 addition & 1 deletion unstructured/partition/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def partition_html(
elif url is not None and not filename and not file and not text:
response = requests.get(url)
if not response.ok:
raise ValueError(f"URL return an error: {response.status_code} {response.text}")
raise ValueError(f"URL return an error: {response.status_code}")

content_type = response.headers.get("Content-Type", "")
if not content_type.startswith("text/html"):
Expand Down

0 comments on commit 962de78

Please sign in to comment.