MsalCustomAuthError class

Memperluas

Properti yang Diwariskan

correlationId
error
errorCodes
errorDescription
message
name
stack
stackTraceLimit

Properti menentukan Error.stackTraceLimit jumlah bingkai tumpukan yang dikumpulkan oleh pelacakan tumpukan (baik yang dihasilkan oleh new Error().stack atau Error.captureStackTrace(obj)).

Nilai defaultnya adalah 10 tetapi dapat diatur ke nomor JavaScript yang valid. Perubahan akan memengaruhi pelacakan tumpukan apa pun yang diambil setelah nilai diubah.

Jika diatur ke nilai non-angka, atau diatur ke angka negatif, pelacakan tumpukan tidak akan menangkap bingkai apa pun.

subError

Metode yang Diwarisi

captureStackTrace(object, Function)

Membuat .stack properti pada targetObject, yang ketika diakses mengembalikan string yang mewakili lokasi dalam kode tempat Error.captureStackTrace() dipanggil.

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

Baris pertama jejak akan diawali dengan ${myObject.name}: ${myObject.message}.

Argumen opsional constructorOpt menerima fungsi. Jika diberikan, semua bingkai di atas constructorOpt, termasuk constructorOpt, akan dihilangkan dari jejak tumpukan yang dihasilkan.

Argumen ini constructorOpt berguna untuk menyembunyikan detail implementasi pembuatan kesalahan dari pengguna. Contohnya:

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[])

Lihat https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Detail Konstruktor

MsalCustomAuthError(string, string, string, number[], string)

new MsalCustomAuthError(error: string, errorDescription?: string, subError?: string, errorCodes?: number[], correlationId?: string)

Parameter

error

string

errorDescription

string

subError

string

errorCodes

number[]

correlationId

string

Detail Properti yang Diwariskan

correlationId

correlationId?: string

Nilai Properti

string

Diwarisi DariCustomAuthError.correlationId

error

error: string

Nilai Properti

string

Diwarisi DariCustomAuthError.error

errorCodes

errorCodes?: number[]

Nilai Properti

number[]

Diwarisi DariCustomAuthError.errorCodes

errorDescription

errorDescription?: string

Nilai Properti

string

Diwarisi DariCustomAuthError.errorDescription

message

message: string

Nilai Properti

string

Diwarisi DariCustomAuthError.message

name

name: string

Nilai Properti

string

Diwariskan DariCustomAuthError.name

stack

stack?: string

Nilai Properti

string

Diwarisi DariCustomAuthError.stack

stackTraceLimit

Properti menentukan Error.stackTraceLimit jumlah bingkai tumpukan yang dikumpulkan oleh pelacakan tumpukan (baik yang dihasilkan oleh new Error().stack atau Error.captureStackTrace(obj)).

Nilai defaultnya adalah 10 tetapi dapat diatur ke nomor JavaScript yang valid. Perubahan akan memengaruhi pelacakan tumpukan apa pun yang diambil setelah nilai diubah.

Jika diatur ke nilai non-angka, atau diatur ke angka negatif, pelacakan tumpukan tidak akan menangkap bingkai apa pun.

static stackTraceLimit: number

Nilai Properti

number

Diwarisi DariCustomAuthError.stackTraceLimit

subError

subError?: string

Nilai Properti

string

Diwarisi DariCustomAuthError.subError

Detail Metode yang Diwarisi

captureStackTrace(object, Function)

Membuat .stack properti pada targetObject, yang ketika diakses mengembalikan string yang mewakili lokasi dalam kode tempat Error.captureStackTrace() dipanggil.

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

Baris pertama jejak akan diawali dengan ${myObject.name}: ${myObject.message}.

Argumen opsional constructorOpt menerima fungsi. Jika diberikan, semua bingkai di atas constructorOpt, termasuk constructorOpt, akan dihilangkan dari jejak tumpukan yang dihasilkan.

Argumen ini constructorOpt berguna untuk menyembunyikan detail implementasi pembuatan kesalahan dari pengguna. Contohnya:

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)

Parameter

targetObject

object

constructorOpt

Function

Diwarisi DariCustomAuthError.captureStackTrace

prepareStackTrace(Error, CallSite[])

Lihat https://v8.dev/docs/stack-trace-api#customizing-stack-traces

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

Parameter

err

Error

stackTraces

CallSite[]

Mengembalikan

any

Diwarisi DariCustomAuthError.prepareStackTrace