fix: return upload limit error code
This commit is contained in:
parent
b7ac08be5d
commit
769af267ea
@ -0,0 +1,16 @@
|
||||
package com.red.circle.external.adapter.app.oss;
|
||||
|
||||
import com.red.circle.external.response.OssErrorCode;
|
||||
import com.red.circle.framework.dto.ResultResponse;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
import org.springframework.web.multipart.MaxUploadSizeExceededException;
|
||||
|
||||
@RestControllerAdvice
|
||||
public class OssUploadExceptionHandler {
|
||||
|
||||
@ExceptionHandler(MaxUploadSizeExceededException.class)
|
||||
public ResultResponse<Void> handleMaxUploadSizeExceeded(MaxUploadSizeExceededException e) {
|
||||
return ResultResponse.failure(OssErrorCode.FILE_SIZE_GREATER_THAN_100M);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user