AutoMLException 類別
指定錯誤類型的其他欄位例外狀況。
建構新的 AutoMLException。
- 繼承
-
azureml._common.exceptions.AzureMLExceptionAutoMLException
建構函式
AutoMLException(exception_message: str = '', target: str | None = None, details: List[str] | None = None, message_format: str | None = None, message_parameters: Dict[str, str] | None = None, reference_code: str | None = None, has_pii: bool = True, azureml_error: AzureMLError | None = None, inner_exception: BaseException | None = None)
參數
- azureml_error
- inner_exception
方法
create_without_pii |
建立標記為不包含 PII 的例外狀況。 |
from_exception |
將任意例外狀況轉換為這個例外狀況類型。 產生的例外狀況標示為包含 PII。 |
get_pii_free_exception_msg_format | |
pii_free_msg |
用於列印 PII 包含資訊不適當的情況的後援訊息。 |
with_generic_msg |
附加泛型錯誤訊息,如果此例外狀況包含 PII,將會用於遙測。 |
create_without_pii
建立標記為不包含 PII 的例外狀況。
create_without_pii(msg: str = '', target: str | None = None, reference_code: str | None = None) -> ExceptionT
參數
- cls
類型類別:class: azureml.automl.core.exceptions.AutoMLException
- msg
要使用的選擇性訊息,而不是原始例外狀況訊息
- target
指向例外狀況目標的選擇性字串
- reference_code
發生失敗的模組或程式碼指標
from_exception
將任意例外狀況轉換為這個例外狀況類型。 產生的例外狀況標示為包含 PII。
from_exception(e: BaseException, msg: str | None = None, target: str | None = None, reference_code: str | None = None, has_pii: bool = True) -> AutoMLException
參數
- cls
類型類別:class: azureml.automl.core.exceptions.AutoMLException
- e
原始例外狀況物件
- msg
要使用的選擇性訊息,而不是原始例外狀況訊息
- target
指向例外狀況目標的選擇性字串
- reference_code
發生失敗的模組或程式碼指標
- has_pii
此例外狀況是否包含 PII
傳回
此類型的新例外狀況,保留原始堆疊追蹤
get_pii_free_exception_msg_format
get_pii_free_exception_msg_format() -> str
pii_free_msg
用於列印 PII 包含資訊不適當的情況的後援訊息。
pii_free_msg(scrubbed: bool = True) -> str
參數
- scrubbed
如果為 true,則傳回泛型 '[Hidden,因為它可能包含 PII]' 做為後援,否則傳回空字串
傳回
記錄安全訊息以記錄遙測
with_generic_msg
附加泛型錯誤訊息,如果此例外狀況包含 PII,將會用於遙測。
with_generic_msg(msg: str) -> ExceptionT
參數
- msg
要使用的泛型訊息
傳回
這個物件
屬性
error_code
取得這個例外狀況的錯誤碼。
error_type
取得這個例外狀況的根錯誤類型。
has_pii
檢查此例外狀況的訊息是否包含 PII。
message_format
如果有的話,請取得記錄安全例外狀況訊息。
target
造成擲回例外狀況的專案名稱。
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應