共用方式為


AutoMLException 類別

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

建構新的 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)

參數

名稱 Description
exception_message
必要
str

描述錯誤的訊息。

target
str

導致擲回例外狀況的項目名稱。

預設值: None
details

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

預設值: None
message_format
str

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

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

對應至message_format內容的值替代

預設值: None
reference_code
str

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

預設值: None
has_pii

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

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

參數

名稱 Description
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

參數

名稱 Description
cls
必要

類型為 :class:azureml.automl.core.exceptions.AutoMLException 的類別

e
必要

原始例外狀況物件

msg

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

預設值: None
target

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

預設值: None
reference_code

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

預設值: None
has_pii

此例外狀況是否包含 PII

預設值: True

傳回

類型 Description

此類型的新例外狀況,保留原始堆疊追蹤

get_pii_free_exception_msg_format

get_pii_free_exception_msg_format() -> str

pii_free_msg

後援訊息用於列印包含 PII 的資訊不適當的情況。

pii_free_msg(scrubbed: bool = True) -> str

參數

名稱 Description
scrubbed

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

預設值: True

傳回

類型 Description

記錄遙測中的安全訊息

with_generic_msg

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

with_generic_msg(msg: str) -> ExceptionT

參數

名稱 Description
msg
必要

要使用的泛型訊息

傳回

類型 Description

這個物件

屬性

error_code

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

error_type

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

has_pii

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

message_format

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

target

導致擲回例外狀況的項目名稱。