fix mojang status endpoint

This commit is contained in:
Lee
2024-07-30 20:49:36 +01:00
parent ee5b1f12d8
commit 2b017f9ef7
8 changed files with 126 additions and 42 deletions

View File

@ -1,6 +1,7 @@
package xyz.mcutils.backend.exception;
import io.micrometer.common.lang.NonNull;
import io.sentry.Sentry;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
@ -39,6 +40,7 @@ public final class ExceptionControllerAdvice {
}
if (status == null) { // Fallback to 500
status = HttpStatus.INTERNAL_SERVER_ERROR;
Sentry.captureException(ex); // Capture the exception with Sentry
}
return new ResponseEntity<>(new ErrorResponse(status, message), status);
}