mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-06-08 21:38:21 +00:00
Nicer 404 error message
This commit is contained in:
parent
76b494f64a
commit
821bbd98ef
@ -254,7 +254,7 @@ public class DefaultDbAdminController {
|
||||
|
||||
DbObject object = repository.findById(schema, id).orElseThrow(() -> {
|
||||
return new DbAdminNotFoundException(
|
||||
"Object " + className + " with id " + id + " not found"
|
||||
schema.getJavaClass().getSimpleName() + " with ID " + id + " not found."
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -9,5 +9,10 @@ public class DbAdminNotFoundException extends ResponseStatusException {
|
||||
public DbAdminNotFoundException(String message) {
|
||||
super(HttpStatus.NOT_FOUND, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return getReason();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user