Skip to content

[destination-convex] Switch json() to text in error handling #42585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions airbyte-integrations/connectors/destination-convex/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Convex source connector
# Convex destination connector


This is the repository for the Convex source connector, written in Python.
This is the repository for the Convex destination connector, written in Python.
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/destinations/convex).

## Local development
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ def _request(
response = requests.request(method=http_method, url=url, headers=headers, json=json)

if response.status_code != 200:
raise Exception(f"Request to {url} failed with: {response.status_code}: {response.json()}")
raise Exception(f"Request to `{url}` failed with status code {response.status_code}: {response.text}")

return response
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data:
connectorType: destination
connectorSubtype: api
definitionId: 3eb4d99c-11fa-4561-a259-fc88e0c2f8f4
dockerImageTag: 0.2.6
dockerImageTag: 0.2.7
dockerRepository: airbyte/destination-convex
githubIssueLabel: destination-convex
icon: convex.svg
Expand Down
41 changes: 21 additions & 20 deletions airbyte-integrations/connectors/destination-convex/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "0.2.6"
version = "0.2.7"
name = "destination-convex"
description = "Destination implementation for Convex."
authors = [ "Airbyte <[email protected]>",]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def setup_bad_response(config):
responses.PUT,
f"{config['deployment_url']}/api/streaming_import/clear_tables",
status=400,
json={"code": "ErrorCode", "message": "error message"},
body="error message",
)


Expand All @@ -108,7 +108,11 @@ def test_bad_write(config: ConvexConfig, configured_catalog: ConfiguredAirbyteCa
client = ConvexClient(config, {})
with pytest.raises(Exception) as e:
client.delete([])
assert "/api/streaming_import/clear_tables failed with: 400: {'code': 'ErrorCode', 'message': 'error message'}" in str(e.value)

assert (
"Request to `http://deployment_url.convex.cloud/api/streaming_import/clear_tables` failed with status code 400: error message"
in str(e.value)
)


@responses.activate
Expand Down
17 changes: 9 additions & 8 deletions docs/integrations/destinations/convex.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ On the [Convex dashboard](https://dashboard.convex.dev/), navigate to the projec

| Version | Date | Pull Request | Subject |
| :------ | :--------- | :------------------------------------------------------- | :---------------------------------------------------------------- |
| 0.2.6 | 2024-07-09 | [41275](https://github.com/airbytehq/airbyte/pull/41275) | Update dependencies |
| 0.2.5 | 2024-07-06 | [40987](https://github.com/airbytehq/airbyte/pull/40987) | Update dependencies |
| 0.2.4 | 2024-06-25 | [40496](https://github.com/airbytehq/airbyte/pull/40496) | Update dependencies |
| 0.2.3 | 2024-06-22 | [40122](https://github.com/airbytehq/airbyte/pull/40122) | Update dependencies |
| 0.2.2 | 2024-06-04 | [39083](https://github.com/airbytehq/airbyte/pull/39083) | [autopull] Upgrade base image to v1.2.1 |
| 0.2.1 | 2024-05-21 | [38527](https://github.com/airbytehq/airbyte/pull/38527) | [autopull] base image + poetry + up_to_date |
| 0.2.0 | 2023-05-15 | [26103](https://github.com/airbytehq/airbyte/pull/26103) | πŸ› Update Convex destination connector to fix overwrite sync mode |
| 0.1.0 | 2023-01-05 | [21287](https://github.com/airbytehq/airbyte/pull/21287) | πŸŽ‰ New Destination: Convex |
| 0.2.7 | 2024-07-31 | [42585](https://github.com/airbytehq/airbyte/pull/42585) | Improve error handling |
| 0.2.6 | 2024-07-09 | [41275](https://github.com/airbytehq/airbyte/pull/41275) | Update dependencies |
| 0.2.5 | 2024-07-06 | [40987](https://github.com/airbytehq/airbyte/pull/40987) | Update dependencies |
| 0.2.4 | 2024-06-25 | [40496](https://github.com/airbytehq/airbyte/pull/40496) | Update dependencies |
| 0.2.3 | 2024-06-22 | [40122](https://github.com/airbytehq/airbyte/pull/40122) | Update dependencies |
| 0.2.2 | 2024-06-04 | [39083](https://github.com/airbytehq/airbyte/pull/39083) | [autopull] Upgrade base image to v1.2.1 |
| 0.2.1 | 2024-05-21 | [38527](https://github.com/airbytehq/airbyte/pull/38527) | [autopull] base image + poetry + up_to_date |
| 0.2.0 | 2023-05-15 | [26103](https://github.com/airbytehq/airbyte/pull/26103) | πŸ› Update Convex destination connector to fix overwrite sync mode |
| 0.1.0 | 2023-01-05 | [21287](https://github.com/airbytehq/airbyte/pull/21287) | πŸŽ‰ New Destination: Convex |

</details>
Loading