VoiceLiveAuthenticationError class

فئة خطأ المصادقة لعمليات الصوت المباشر

يمتد

الخصائص الموروثة

cause

الخطأ الأصلي الذي تسبب في هذا الخطأ، إن وجد.

ملاحظة: المعيار Error.cause (ES2022) يكتب ك unknown لأن الكود بشكل عام يمكنه إخفاء أي شيء. نضيق ذلك إلى Error أن كل موقع استدعاء في هذا ال SDK داخلي ودائما يلف القيم غير القابلةError للقبول قبل بناء أحد هذه الأخطاء (انظر classifyConnectionError).

code

رمز الخطأ يحدد نوع الخطأ المحدد

context

معلومات السياق حول مكان حدوث الخطأ

message
name
recoverable

يشير إلى ما إذا كان هذا الخطأ قابلا للاسترجاع

stack
stackTraceLimit

تحدد الخاصية Error.stackTraceLimit عدد إطارات المكدس التي تم تجميعها بواسطة تتبع مكدس (سواء تم إنشاؤها بواسطة new Error().stack أو Error.captureStackTrace(obj)).

القيمة الافتراضية هي 10 ولكن يمكن تعيينها إلى أي رقم JavaScript صالح. ستؤثر التغييرات على أي تتبع مكدس تم التقاطه بعد تغيير القيمة.

إذا تم تعيينها إلى قيمة غير رقمية، أو تم تعيينها على رقم سالب، فلن تلتقط تتبعات المكدس أي إطارات.

timestamp

الطابع الزمني عند حدوث الخطأ

الأساليب المتوارثة

captureStackTrace(object, Function)

ينشئ خاصية .stack على targetObject، والتي عند الوصول إليها ترجع سلسلة تمثل الموقع في التعليمات البرمجية التي Error.captureStackTrace() تم استدعاؤها عنده.

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

سيتم مسبوق السطر الأول من التتبع ب ${myObject.name}: ${myObject.message}.

تقبل الوسيطة الاختيارية 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

تفاصيل المنشئ

VoiceLiveAuthenticationError(string, string, Error)

new VoiceLiveAuthenticationError(message: string, code: string, cause?: Error)

المعلمات

message

string

code

string

cause

Error

تفاصيل الخاصية الموروثة

cause

الخطأ الأصلي الذي تسبب في هذا الخطأ، إن وجد.

ملاحظة: المعيار Error.cause (ES2022) يكتب ك unknown لأن الكود بشكل عام يمكنه إخفاء أي شيء. نضيق ذلك إلى Error أن كل موقع استدعاء في هذا ال SDK داخلي ودائما يلف القيم غير القابلةError للقبول قبل بناء أحد هذه الأخطاء (انظر classifyConnectionError).

cause?: Error

قيمة الخاصية

Error

موروث منVoiceLiveConnectionError.cause

code

رمز الخطأ يحدد نوع الخطأ المحدد

code: string

قيمة الخاصية

string

موروث منVoiceLiveConnectionError.code

context

معلومات السياق حول مكان حدوث الخطأ

context: string

قيمة الخاصية

string

موروث منVoiceLiveConnectionError.context

message

message: string

قيمة الخاصية

string

موروث منVoiceLiveConnectionError.message

name

name: string

قيمة الخاصية

string

ورث منVoiceLiveConnectionError.name

recoverable

يشير إلى ما إذا كان هذا الخطأ قابلا للاسترجاع

recoverable: boolean

قيمة الخاصية

boolean

موروث منVoiceLiveConnectionError.recoverable

stack

stack?: string

قيمة الخاصية

string

موروث منVoiceLiveConnectionError.stack

stackTraceLimit

تحدد الخاصية Error.stackTraceLimit عدد إطارات المكدس التي تم تجميعها بواسطة تتبع مكدس (سواء تم إنشاؤها بواسطة new Error().stack أو Error.captureStackTrace(obj)).

القيمة الافتراضية هي 10 ولكن يمكن تعيينها إلى أي رقم JavaScript صالح. ستؤثر التغييرات على أي تتبع مكدس تم التقاطه بعد تغيير القيمة.

إذا تم تعيينها إلى قيمة غير رقمية، أو تم تعيينها على رقم سالب، فلن تلتقط تتبعات المكدس أي إطارات.

static stackTraceLimit: number

قيمة الخاصية

number

موروث منVoiceLiveConnectionError.stackTraceLimit

timestamp

الطابع الزمني عند حدوث الخطأ

timestamp: Date

قيمة الخاصية

Date

موروث منVoiceLiveConnectionError.timestamp

تفاصيل الأساليب المتوارثة

captureStackTrace(object, Function)

ينشئ خاصية .stack على targetObject، والتي عند الوصول إليها ترجع سلسلة تمثل الموقع في التعليمات البرمجية التي Error.captureStackTrace() تم استدعاؤها عنده.

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

سيتم مسبوق السطر الأول من التتبع ب ${myObject.name}: ${myObject.message}.

تقبل الوسيطة الاختيارية 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

موروث منVoiceLiveConnectionError.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

موروث منVoiceLiveConnectionError.prepareStackTrace