Skip to content

Commit f6b3fb9

Browse files
committed
fix
1 parent b7097fe commit f6b3fb9

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

mpt_api_client/http/client_utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
from typing import Any
33
from urllib.parse import urlsplit, urlunparse
44

5-
INVALID_ENV_URL_MESSAGE = "Invalid base URL. Expected scheme://host[:port]"
5+
INVALID_ENV_URL_MESSAGE = (
6+
"Base URL is required. "
7+
"Set it up as env variable MPT_URL or pass it as `base_url` "
8+
"argument to MPTClient. Expected format scheme://host[:port]"
9+
)
610
PATH_TO_REMOVE_RE = re.compile(r"^/$|^/public/?$|^/public/v1/?$")
711

812

913
def validate_base_url(base_url: Any) -> str:
1014
"""Validate base url."""
1115
if not base_url or not isinstance(base_url, str):
12-
raise ValueError(
13-
"Base URL is required. "
14-
"Set it up as env variable MPT_URL or pass it as `base_url` "
15-
"argument to MPTClient."
16-
)
16+
raise ValueError(INVALID_ENV_URL_MESSAGE)
1717
split_result = urlsplit(base_url, scheme="https")
1818
if split_result.scheme and split_result.hostname:
1919
host = (

0 commit comments

Comments
 (0)