mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 14:44:43 -04:00
AuthController: Return 409 Conflict when user already exists
The previously used HTTP error 400 'Bad Request' is not really applicable here, as the client did not send a malformed message. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
b73ac2f99b
commit
c02f845ecb
2 changed files with 3 additions and 2 deletions
|
@ -6,6 +6,7 @@
|
|||
import {
|
||||
BadRequestException,
|
||||
Body,
|
||||
ConflictException,
|
||||
Controller,
|
||||
Delete,
|
||||
NotFoundException,
|
||||
|
@ -56,7 +57,7 @@ export class AuthController {
|
|||
return;
|
||||
} catch (e) {
|
||||
if (e instanceof AlreadyInDBError) {
|
||||
throw new BadRequestException(e.message);
|
||||
throw new ConflictException(e.message);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue