File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
server/src/main/java/org/eclipse/openvsx/web Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ /** ******************************************************************************
2+ * Copyright (c) 2024 Precies. Software OU and others
3+ *
4+ * This program and the accompanying materials are made available under the
5+ * terms of the Eclipse Public License v. 2.0 which is available at
6+ * http://www.eclipse.org/legal/epl-2.0.
7+ *
8+ * SPDX-License-Identifier: EPL-2.0
9+ * ****************************************************************************** */
10+ package org .eclipse .openvsx .web ;
11+
12+ import org .eclipse .openvsx .util .UrlUtil ;
13+ import org .springframework .beans .factory .annotation .Value ;
14+ import org .springframework .boot .autoconfigure .condition .ConditionalOnProperty ;
15+ import org .springframework .boot .web .servlet .error .ErrorController ;
16+ import org .springframework .stereotype .Controller ;
17+ import org .springframework .web .bind .annotation .RequestMapping ;
18+
19+ @ Controller
20+ @ ConditionalOnProperty (value = "server.error.path" , havingValue = "/server-error" )
21+ public class ServerErrorController implements ErrorController {
22+
23+ @ Value ("${ovsx.webui.url:}" )
24+ String webuiUrl ;
25+
26+ @ RequestMapping ("/server-error" )
27+ public String handleError () {
28+ return "redirect:" + UrlUtil .createApiUrl (webuiUrl , "error" );
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments