VoiceLiveConnectionError class
فئة الخطأ الأساسية لعمليات Voice Live WebSocket
- يمتد
-
Error
الخصائص
| cause | الخطأ الأصلي الذي تسبب في هذا الخطأ، إن وجد |
| code | رمز الخطأ يحدد نوع الخطأ المحدد |
| context | معلومات السياق حول مكان حدوث الخطأ |
| recoverable | يشير إلى ما إذا كان هذا الخطأ قابلا للاسترجاع |
| timestamp | الطابع الزمني عند حدوث الخطأ |
الخصائص الموروثة
| message | |
| name | |
| stack | |
| stack |
تحدد الخاصية القيمة الافتراضية هي إذا تم ضبطها على قيمة غير رقمية، أو على رقم سالب، فلن تلتقط مسارات المكدس أي إطارات. |
الأساليب المتوارثة
| capture |
ينشئ خاصية
السطر الأول من المسار سيسبق ب الوسيط الاختياري الحجة
|
| prepare |
راجع https://v8.dev/docs/stack-trace-api#customizing-stack-traces |
تفاصيل المنشئ
VoiceLiveConnectionError(string, string, string, boolean, Error)
new VoiceLiveConnectionError(message: string, code: string, context?: string, recoverable?: boolean, cause?: Error)
المعلمات
- message
-
string
- code
-
string
- context
-
string
- recoverable
-
boolean
- cause
-
Error
تفاصيل الخاصية
cause
الخطأ الأصلي الذي تسبب في هذا الخطأ، إن وجد
cause?: Error
قيمة الخاصية
Error
code
رمز الخطأ يحدد نوع الخطأ المحدد
code: string
قيمة الخاصية
string
context
معلومات السياق حول مكان حدوث الخطأ
context: string
قيمة الخاصية
string
recoverable
يشير إلى ما إذا كان هذا الخطأ قابلا للاسترجاع
recoverable: boolean
قيمة الخاصية
boolean
timestamp
الطابع الزمني عند حدوث الخطأ
timestamp: Date
قيمة الخاصية
Date
تفاصيل الخاصية الموروثة
message
message: string
قيمة الخاصية
string
موروثة من رسالة خطأ
name
name: string
قيمة الخاصية
string
موروثة من Error.name
stack
stack?: string
قيمة الخاصية
string
موروثة من Error.stack
stackTraceLimit
تحدد الخاصية Error.stackTraceLimit عدد إطارات المكدس التي جمعها تتبع المكدس (سواء تم توليدها بواسطة new Error().stack أو Error.captureStackTrace(obj)).
القيمة الافتراضية هي 10 ولكن يمكن تعيينها على أي رقم جافاسكريبت صالح. التغييرات ستؤثر على أي تتبع مكدس يتم التقاطه بعد تغيير القيمة.
إذا تم ضبطها على قيمة غير رقمية، أو على رقم سالب، فلن تلتقط مسارات المكدس أي إطارات.
static stackTraceLimit: number
قيمة الخاصية
number
الموروث من Error.stackTraceLimit
تفاصيل الأساليب المتوارثة
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
الموروث من Error.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
الموروث من Error.prepareStackTrace