Skip to content

Commit 6aaa3ef

Browse files
improve error message logging
1 parent 9881dcb commit 6aaa3ef

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ads/aqua/model/model.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
InferenceContainerTypeFamily,
2020
Tags,
2121
)
22-
from ads.aqua.common.errors import AquaRuntimeError, AquaValueError
22+
from ads.aqua.common.errors import (
23+
AquaFileNotFoundError,
24+
AquaRuntimeError,
25+
AquaValueError,
26+
)
2327
from ads.aqua.common.utils import (
2428
LifecycleStatus,
2529
_build_resource_identifier,
@@ -1206,7 +1210,9 @@ def _validate_safetensor_format(
12061210
except Exception as ex:
12071211
logger.error(
12081212
f"Exception occurred while loading config file from {import_model_details.os_path}"
1209-
f"Exception message: {ex}"
1213+
)
1214+
logger.error(
1215+
ex.reason if isinstance(ex, AquaFileNotFoundError) else str(ex)
12101216
)
12111217
if not import_model_details.ignore_model_artifact_check:
12121218
raise AquaRuntimeError(

0 commit comments

Comments
 (0)