feat: add PasswordTooWeak error

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2022-09-25 02:02:26 +02:00 committed by David Mehren
parent ac5e059243
commit d7c58b9de5
2 changed files with 9 additions and 1 deletions

View file

@ -66,6 +66,10 @@ const mapOfHedgeDocErrorsToHttpErrors: Map<string, HttpExceptionConstructor> =
'NoLocalIdentityError',
(object): HttpException => new BadRequestException(object),
],
[
'PasswordTooWeakError',
(object): HttpException => new BadRequestException(object),
],
]);
@Catch()

View file

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
@ -51,3 +51,7 @@ export class InvalidCredentialsError extends Error {
export class NoLocalIdentityError extends Error {
name = 'NoLocalIdentityError';
}
export class PasswordTooWeakError extends Error {
name = 'PasswordTooWeakError';
}