共用方式為


AutoMLException 類別

指定錯誤類型的其他欄位例外狀況。

建構新的 AutoMLException。

繼承
azureml._common.exceptions.AzureMLException
AutoMLException

建構函式

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)

參數

exception_message
str
必要

描述錯誤的訊息。

target
str
預設值: None

造成擲回例外狀況的專案名稱。

details
list(str)
預設值: None

錯誤的任何其他資訊,例如其他錯誤回應或堆疊追蹤。

message_format
str
預設值: None

沒有變數替代的未格式化exception_message版本。

message_parameters
<xref:Dictionary>[str, str]
預設值: None

對應至message_format內容的值替代

reference_code
str
預設值: None

發生失敗的模組或程式碼指標

has_pii
bool
預設值: True

布林值,表示例外狀況訊息是否有任何 PII 資訊。

azureml_error
預設值: None
inner_exception
預設值: None

方法

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
預設值: None

指向例外狀況目標的選擇性字串

reference_code
預設值: None

發生失敗的模組或程式碼指標

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
預設值: None

要使用的選擇性訊息,而不是原始例外狀況訊息

target
預設值: None

指向例外狀況目標的選擇性字串

reference_code
預設值: None

發生失敗的模組或程式碼指標

has_pii
預設值: True

此例外狀況是否包含 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

如果為 true,則傳回泛型 '[Hidden,因為它可能包含 PII]' 做為後援,否則傳回空字串

傳回

記錄安全訊息以記錄遙測

with_generic_msg

附加泛型錯誤訊息,如果此例外狀況包含 PII,將會用於遙測。

with_generic_msg(msg: str) -> ExceptionT

參數

msg
必要

要使用的泛型訊息

傳回

這個物件

屬性

error_code

取得這個例外狀況的錯誤碼。

error_type

取得這個例外狀況的根錯誤類型。

has_pii

檢查此例外狀況的訊息是否包含 PII。

message_format

如果有的話,請取得記錄安全例外狀況訊息。

target

造成擲回例外狀況的專案名稱。