|
4 | 4 | import io.papermc.hangar.exceptions.HangarApiException;
|
5 | 5 | import io.papermc.hangar.exceptions.HangarResponseException;
|
6 | 6 | import io.papermc.hangar.exceptions.MultiHangarApiException;
|
7 |
| -import io.undertow.server.RequestTooBigException; |
8 |
| -import io.undertow.server.handlers.form.MultiPartParserDefinition; |
| 7 | +//import io.undertow.server.RequestTooBigException; |
| 8 | +//import io.undertow.server.handlers.form.MultiPartParserDefinition; |
9 | 9 | import jakarta.servlet.http.HttpServletRequest;
|
10 | 10 | import java.util.Optional;
|
11 | 11 | import org.jetbrains.annotations.NotNull;
|
@@ -85,17 +85,17 @@ protected ResponseEntity<Object> handleExceptionInternal(final @NotNull Exceptio
|
85 | 85 | return new ResponseEntity<>(ex, headers, status);
|
86 | 86 | }
|
87 | 87 |
|
88 |
| - @ExceptionHandler(MultiPartParserDefinition.FileTooLargeException.class) |
89 |
| - public ResponseEntity<HangarApiException> handleException(final MultiPartParserDefinition.FileTooLargeException exception) { |
90 |
| - final HangarApiException apiException = new HangarApiException(HttpStatus.PAYLOAD_TOO_LARGE, "File too large - files have to be less than " + this.config.projects().maxFileSizeMB() + "MB in size"); |
91 |
| - return new ResponseEntity<>(apiException, HttpStatus.PAYLOAD_TOO_LARGE); |
92 |
| - } |
93 |
| - |
94 |
| - @ExceptionHandler(RequestTooBigException.class) |
95 |
| - public ResponseEntity<HangarApiException> handleException(final RequestTooBigException exception) { |
96 |
| - final HangarApiException apiException = new HangarApiException(HttpStatus.PAYLOAD_TOO_LARGE, "File too large - files have to be less than " + this.config.projects().maxTotalFilesSizeMB() + "MB total"); |
97 |
| - return new ResponseEntity<>(apiException, HttpStatus.PAYLOAD_TOO_LARGE); |
98 |
| - } |
| 88 | + //@ExceptionHandler(MultiPartParserDefinition.FileTooLargeException.class) |
| 89 | + //public ResponseEntity<HangarApiException> handleException(final MultiPartParserDefinition.FileTooLargeException exception) { |
| 90 | + // final HangarApiException apiException = new HangarApiException(HttpStatus.PAYLOAD_TOO_LARGE, "File too large - files have to be less than " + this.config.projects().maxFileSizeMB() + "MB in size"); |
| 91 | + // return new ResponseEntity<>(apiException, HttpStatus.PAYLOAD_TOO_LARGE); |
| 92 | + //} |
| 93 | + // |
| 94 | + //@ExceptionHandler(RequestTooBigException.class) |
| 95 | + //public ResponseEntity<HangarApiException> handleException(final RequestTooBigException exception) { |
| 96 | + // final HangarApiException apiException = new HangarApiException(HttpStatus.PAYLOAD_TOO_LARGE, "File too large - files have to be less than " + this.config.projects().maxTotalFilesSizeMB() + "MB total"); |
| 97 | + // return new ResponseEntity<>(apiException, HttpStatus.PAYLOAD_TOO_LARGE); |
| 98 | + //} |
99 | 99 |
|
100 | 100 | @Override
|
101 | 101 | protected ResponseEntity<Object> handleMaxUploadSizeExceededException(final @NotNull MaxUploadSizeExceededException ex, final @NotNull HttpHeaders headers, final @NotNull HttpStatusCode status, final @NotNull WebRequest request) {
|
|
0 commit comments