HarnessException

public class HarnessException
extends Exception implements IHarnessException

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ com.android.tradefed.error.HarnessException


在安全機制中擲回的例外狀況基本類別。這個類別有助於攜帶 ErrorIdentifier 來回報失敗詳細資料。

摘要

公用建構函式

HarnessException(ErrorIdentifier errorId)
HarnessException(String message, ErrorIdentifier errorId)
HarnessException(String message, Throwable cause, ErrorIdentifier errorId)
HarnessException(Throwable cause, ErrorIdentifier errorId)

公用方法

ErrorIdentifier getErrorId()

傳回與例外狀況相關聯的 ErrorIdentifier

String getOrigin()

傳回例外狀況的來源。

String toString()

受保護的方法

final void setCallerClass(Class<?> clazz)
final void setCallerClass(String clazz)

公用建構函式

HarnessException

public HarnessException (ErrorIdentifier errorId)

參數
errorId ErrorIdentifier

HarnessException

public HarnessException (String message, 
                ErrorIdentifier errorId)

參數
message String

errorId ErrorIdentifier

HarnessException

public HarnessException (String message, 
                Throwable cause, 
                ErrorIdentifier errorId)

參數
message String

cause Throwable

errorId ErrorIdentifier

HarnessException

public HarnessException (Throwable cause, 
                ErrorIdentifier errorId)

參數
cause Throwable

errorId ErrorIdentifier

公用方法

getErrorId

public ErrorIdentifier getErrorId ()

傳回與例外狀況相關聯的 ErrorIdentifier。可為空值。

傳回
ErrorIdentifier

getOrigin

public String getOrigin ()

傳回例外狀況的來源。

傳回
String

toString

public String toString ()

傳回
String

受保護的方法

setCallerClass

protected final void setCallerClass (Class<?> clazz)

參數
clazz Class

setCallerClass

protected final void setCallerClass (String clazz)

參數
clazz String