Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/src/org/labkey/api/view/HttpView.java
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ public static HttpView<?> redirect(ActionURL url)
return redirect(url.getLocalURIString());
}

@Deprecated(forRemoval = true) // Use ActionURL or URLHelper variant instead. TODO: Remove
public static HttpView<?> redirect(String url)
{
throw new RedirectException(url);
Expand Down
10 changes: 8 additions & 2 deletions query/src/org/labkey/query/reports/ReportsController.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
import org.labkey.api.view.NavTree;
import org.labkey.api.view.NotFoundException;
import org.labkey.api.view.Portal;
import org.labkey.api.view.RedirectException;
import org.labkey.api.view.UnauthorizedException;
import org.labkey.api.view.VBox;
import org.labkey.api.view.ViewBackgroundInfo;
Expand Down Expand Up @@ -199,7 +200,6 @@
import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.labkey.api.reports.model.ViewCategoryManager.UNCATEGORIZED_ROWID;
import static org.labkey.api.util.DOM.DIV;
import static org.labkey.api.util.DOM.SPAN;
import static org.labkey.api.util.DOM.cl;

public class ReportsController extends SpringActionController
Expand Down Expand Up @@ -1017,9 +1017,15 @@ public ModelAndView getView(ReportDesignBean<?> form, BindException errors) thro
{
reportView = _report.getRunReportView(getViewContext());
}
catch (RedirectException re)
{
// Link reports throw RedirectException... pass it on
throw re;
}
catch (RuntimeException e)
{
return new HtmlView(SPAN(cl("labkey-error"), e.getMessage(), ". Unable to create report."));
String message = Objects.requireNonNullElse(e.getMessage(), e.getClass().getSimpleName()) + ". Unable to create report.";
return HtmlView.err(message);
}

if (!isPrint() && DiscussionService.get() != null)
Expand Down