AuthenticationError class
Classe generale AuthenticationError per rappresentare un errore di autenticazione con stato del codice.
- Extends
-
Error
Costruttori
| Authentication |
Inizializza una nuova istanza della classe AuthenticationError |
Proprietà
| Error | |
| status |
Proprietà ereditate
| message | |
| name | |
| stack |
Metodi
| determine |
Usato per determinare un codice di stato dal messaggio di errore per i |
| is |
Corrobora che l'errore è di tipo IStatusCodeError. |
Dettagli costruttore
AuthenticationError(string, StatusCode)
Inizializza una nuova istanza della classe AuthenticationError
new AuthenticationError(message: string, statusCode: StatusCode)
Parametri
- message
-
string
Messaggio di errore.
- statusCode
- StatusCode
Numero StatusCode da utilizzare.
Dettagli proprietà
Error
static Error: ErrorConstructor
Valore della proprietà
ErrorConstructor
statusCode
Dettagli proprietà ereditate
message
message: string
Valore della proprietà
string
Ereditato da Error.message
name
name: string
Valore della proprietà
string
ereditato da Error.name
stack
stack?: string
Valore della proprietà
string
ereditato da Error.stack
Dettagli metodo
determineStatusCodeAndBuildMessage(any)
Usato per determinare un codice di stato dal messaggio di errore per iIStatusCodeErrornon.
static function determineStatusCodeAndBuildMessage(err: any): string
Parametri
- err
-
any
Errore generato, utilizzato per determinare un codice di stato appropriato.
Restituisce
string
Messaggio di errore da inviare come risposta.
isStatusCodeError(any)
Corrobora che l'errore è di tipo IStatusCodeError.
static function isStatusCodeError(err: any): boolean
Parametri
- err
-
any
Errore da convalidare.
Restituisce
boolean
Se err è un IStatusCodeError, il risultato è true; in caso contrario false.