mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-28 01:32:17 +00:00
fix(vertex): format messages, handle undecodable credential files
This commit is contained in:
parent
713ab8fd29
commit
6c999c558c
1 changed files with 2 additions and 3 deletions
|
|
@ -150,8 +150,7 @@ class VertexBase:
|
|||
json_obj = json.load(f)
|
||||
except FileNotFoundError as e:
|
||||
raise Exception(
|
||||
"Unable to load vertex credentials from file path: "
|
||||
f"{credentials}. File not found. ({e})"
|
||||
f"Unable to load vertex credentials from file path: {credentials}. File not found. ({e})"
|
||||
) from e
|
||||
except PermissionError as e:
|
||||
raise Exception(
|
||||
|
|
@ -163,7 +162,7 @@ class VertexBase:
|
|||
"Unable to load vertex credentials from file path: "
|
||||
f"{credentials}. Unable to read file. ({e})"
|
||||
) from e
|
||||
except json.JSONDecodeError as e:
|
||||
except (json.JSONDecodeError, UnicodeDecodeError) as e:
|
||||
raise Exception(
|
||||
"Unable to load vertex credentials from file path: "
|
||||
f"{credentials}. Ensure the JSON is valid "
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue