ServiceBusError class

服務總線內發生的錯誤。

Extends

屬性

code

失敗的原因。

  • GeneralError:異常是用戶端庫中常規錯誤的結果。
  • MessagingEntityNotFound:Service Bus 服務找不到 Service Bus 資源。
  • MessageLockLost:消息上的鎖丟失。 呼叫端應該嘗試再次接收和處理訊息。
  • MessageNotFound:未找到請求的消息。
  • MessageSizeExceeded:消息大於其傳輸允許的最大大小。
  • MessagingEntityAlreadyExists:同一命名空間下存在同名實體。
  • MessagingEntityDisabled:消息傳送實體已禁用。 使用入口網站再次啟用實體。
  • QuotaExceeded:在與 Azure 服務總線服務交互時,已超出應用於服務總線資源的配額。
  • ServiceBusy:Azure 服務總線服務報告它正忙,以回應用戶端執行作的請求。
  • ServiceTimeout:與 Azure 服務總線服務交互時作或其他請求超時。
  • ServiceCommunicationProblem:與 Azure 服務總線服務交互時遇到常規通信錯誤。
  • SessionCannotBeLocked:無法鎖定請求的會話。
  • SessionLockLost:會話上的鎖已過期。 呼叫端應該再次要求會話。
  • UnauthorizedAccess“:用戶無權訪問實體。

繼承的屬性

address

網路連線失敗的位址。 只有當 MessagingError 是以 Node.js SystemError具現化時,才會存在。

errno

系統提供的錯誤號碼。 只有當 MessagingError 是以 Node.js SystemError具現化時,才會存在。

info

有關錯誤的額外詳細數據。

message
name

錯誤名稱。 默認值:「MessagingError」。。

port

無法使用的網路連線埠。 只有當 MessagingError 是以 Node.js SystemError具現化時,才會存在。

retryable

描述錯誤是否可重試。 默認值:true。

stack
stackTraceLimit

該 Error.stackTraceLimit 屬性指定堆疊跟蹤收集的堆疊幀數(無論是由 new Error().stack 還是 Error.captureStackTrace(obj)生成)。

默認值為 10 but can be set to any valid JavaScript number. 更改將影響在更改值 後 捕獲的任何堆疊跟蹤。

如果設置為非數位值或設置為負數,則堆疊跟蹤將不會捕獲任何幀。

syscall

觸發錯誤之系統呼叫的名稱。 只有當 MessagingError 是以 Node.js SystemError具現化時,才會存在。

繼承的方法

captureStackTrace(object, Function)

在上創建一個 .stack 屬性,該屬性在訪問時返回一個字串,該字串 targetObject表示調用的代碼 Error.captureStackTrace() 中的位置。

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

跟蹤的第一行將以 為 ${myObject.name}: ${myObject.message}前綴。

optional constructorOpt 參數接受一個函數。 如果給定,則 上面的 constructorOpt所有幀 ,包括 constructorOpt,將從生成的堆疊跟蹤中省略。

該 constructorOpt 參數可用於向使用者隱藏錯誤生成的實現詳細資訊。 例如:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
prepareStackTrace(Error, CallSite[])

請參閱 https://v8.dev/docs/stack-trace-api#customizing-stack-traces

建構函式詳細資料

ServiceBusError(MessagingError)

new ServiceBusError(messagingError: MessagingError)

參數

messagingError
MessagingError

將屬性複製到 ServiceBusError 的錯誤。

ServiceBusError(string, ServiceBusErrorCode)

new ServiceBusError(message: string, code: ServiceBusErrorCode)

參數

message

string

提供錯誤詳細信息的錯誤訊息。

code
ServiceBusErrorCode

失敗的原因。

屬性詳細資料

code

失敗的原因。

  • GeneralError:異常是用戶端庫中常規錯誤的結果。
  • MessagingEntityNotFound:Service Bus 服務找不到 Service Bus 資源。
  • MessageLockLost:消息上的鎖丟失。 呼叫端應該嘗試再次接收和處理訊息。
  • MessageNotFound:未找到請求的消息。
  • MessageSizeExceeded:消息大於其傳輸允許的最大大小。
  • MessagingEntityAlreadyExists:同一命名空間下存在同名實體。
  • MessagingEntityDisabled:消息傳送實體已禁用。 使用入口網站再次啟用實體。
  • QuotaExceeded:在與 Azure 服務總線服務交互時,已超出應用於服務總線資源的配額。
  • ServiceBusy:Azure 服務總線服務報告它正忙,以回應用戶端執行作的請求。
  • ServiceTimeout:與 Azure 服務總線服務交互時作或其他請求超時。
  • ServiceCommunicationProblem:與 Azure 服務總線服務交互時遇到常規通信錯誤。
  • SessionCannotBeLocked:無法鎖定請求的會話。
  • SessionLockLost:會話上的鎖已過期。 呼叫端應該再次要求會話。
  • UnauthorizedAccess“:用戶無權訪問實體。
code: ServiceBusErrorCode

屬性值

繼承的屬性詳細資料

address

網路連線失敗的位址。 只有當 MessagingError 是以 Node.js SystemError具現化時,才會存在。

address?: string

屬性值

string

繼承自MessagingError.address

errno

系統提供的錯誤號碼。 只有當 MessagingError 是以 Node.js SystemError具現化時,才會存在。

errno?: string | number

屬性值

string | number

繼承自MessagingError.errno

info

有關錯誤的額外詳細數據。

info?: any

屬性值

any

繼承自MessagingError.info

message

message: string

屬性值

string

繼承自MessagingError.message

name

錯誤名稱。 默認值:「MessagingError」。。

name: string

屬性值

string

繼承自MessagingError.name

port

無法使用的網路連線埠。 只有當 MessagingError 是以 Node.js SystemError具現化時,才會存在。

port?: number

屬性值

number

繼承自MessagingError.port

retryable

描述錯誤是否可重試。 默認值:true。

retryable: boolean

屬性值

boolean

繼承自MessagingError.retryable

stack

stack?: string

屬性值

string

繼承自MessagingError.stack

stackTraceLimit

該 Error.stackTraceLimit 屬性指定堆疊跟蹤收集的堆疊幀數(無論是由 new Error().stack 還是 Error.captureStackTrace(obj)生成)。

默認值為 10 but can be set to any valid JavaScript number. 更改將影響在更改值 後 捕獲的任何堆疊跟蹤。

如果設置為非數位值或設置為負數,則堆疊跟蹤將不會捕獲任何幀。

static stackTraceLimit: number

屬性值

number

繼承自MessagingError.stackTraceLimit

syscall

觸發錯誤之系統呼叫的名稱。 只有當 MessagingError 是以 Node.js SystemError具現化時,才會存在。

syscall?: string

屬性值

string

繼承自MessagingError.syscall

繼承的方法的詳細資料

captureStackTrace(object, Function)

在上創建一個 .stack 屬性,該屬性在訪問時返回一個字串,該字串 targetObject表示調用的代碼 Error.captureStackTrace() 中的位置。

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

跟蹤的第一行將以 為 ${myObject.name}: ${myObject.message}前綴。

optional constructorOpt 參數接受一個函數。 如果給定,則 上面的 constructorOpt所有幀 ,包括 constructorOpt,將從生成的堆疊跟蹤中省略。

該 constructorOpt 參數可用於向使用者隱藏錯誤生成的實現詳細資訊。 例如:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
static function captureStackTrace(targetObject: object, constructorOpt?: Function)

參數

targetObject

object

constructorOpt

Function

繼承自MessagingError.captureStackTrace

prepareStackTrace(Error, CallSite[])

請參閱 https://v8.dev/docs/stack-trace-api#customizing-stack-traces

static function prepareStackTrace(err: Error, stackTraces: CallSite[]): any

參數

err

Error

stackTraces

CallSite[]

傳回

any

繼承自MessagingError.prepareStackTrace