mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-06-09 05:48:20 +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(() -> {
|
DbObject object = repository.findById(schema, id).orElseThrow(() -> {
|
||||||
return new DbAdminNotFoundException(
|
return new DbAdminNotFoundException(
|
||||||
"Object " + className + " with id " + id + " not found"
|
schema.getJavaClass().getSimpleName() + " with ID " + id + " not found."
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -10,4 +10,9 @@ public class DbAdminNotFoundException extends ResponseStatusException {
|
|||||||
super(HttpStatus.NOT_FOUND, message);
|
super(HttpStatus.NOT_FOUND, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getMessage() {
|
||||||
|
return getReason();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user