Optional的orElseThrow方法怎么抛出异常
没有报错的示例
return tenantRepository.findById(id) .orElseThrow(() -> new NoSuchElementException("Resource not found: " + id));
模仿写的,抛出http错误就报错
return auditLogRepository.findById(id)
.orElseThrow(()->new HttpStatusException(HttpStatus.EXPECTATION_FAILED, "未找到该id对应的日志"));