Nicer 404 error message

This commit is contained in:
Francesco 2023-10-11 11:15:20 +02:00
parent 76b494f64a
commit 821bbd98ef
2 changed files with 6 additions and 1 deletions

View File

@ -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."
);
});

View File

@ -9,5 +9,10 @@ public class DbAdminNotFoundException extends ResponseStatusException {
public DbAdminNotFoundException(String message) {
super(HttpStatus.NOT_FOUND, message);
}
@Override
public String getMessage() {
return getReason();
}
}