Skip to content

Commit

Permalink
Merge branch 'staging' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-koontz committed Jun 8, 2024
2 parents c536ff7 + abcf53c commit ab03840
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mindsdb_sdk/__about__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__title__ = 'mindsdb_sdk'
__package_name__ = 'mindsdb_sdk'
__version__ = '2.4.1'
__version__ = '2.4.2'
__description__ = "MindsDB Python SDK, provides an SDK to use a remote mindsdb instance"
__email__ = "[email protected]"
__author__ = 'MindsDB Inc'
Expand Down
11 changes: 9 additions & 2 deletions mindsdb_sdk/utils/mind.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import requests
from logging import getLogger

logger = getLogger(__name__)


# Define the Mind entity
Expand Down Expand Up @@ -46,8 +49,12 @@ def create_mind(
"data_source_type": data_source_type,
"data_source_connection_args": data_source_connection_args
}
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
try:
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
except requests.exceptions.HTTPError as e:
logger.error(f"Failed to create mind: {e.response.json()}")
raise e

name = response.json()['name']

Expand Down

0 comments on commit ab03840

Please sign in to comment.