Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Alba María Álvarez
/
AppRecetas
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f51a7bbd
authored
Jun 15, 2025
by
Alba María Álvarez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
perf(CreateUserController): añadido control de excepción para valores únicos
parent
c995361b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
src/main/java/com/example/apprecetas/user/infrastructure/controller/CreateUserController.java
src/main/java/com/example/apprecetas/user/infrastructure/controller/CreateUserController.java
View file @
f51a7bbd
...
...
@@ -31,8 +31,12 @@ public class CreateUserController {
.
collect
(
Collectors
.
joining
(
"; "
));
throw
new
UnprocessableEntityException
(
errorMsg
);
}
try
{
URI
location
=
URI
.
create
(
"/user"
);
return
ResponseEntity
.
created
(
location
).
body
(
service
.
create
(
userInputDto
));
}
catch
(
Exception
e
)
{
throw
new
UnprocessableEntityException
(
"Usuario ya registrado. Cambie sus credenciales."
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment