abort function
Stop the request and answer with code.
if (post.userId != req.auth?.id()) abort(403);
abort(404, 'No post with this id');
Implementation
Never abort(
int code, [
dynamic message,
Map<String, String> headers = const <String, String>{},
]) {
throw HttpStatusException(code, message: message, headers: headers);
}