Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
리팩토링
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Feb 18, 2024
1 parent 9e5802e commit c029fc8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public enum ErrorCode {

MAIL_CONFIRM_FAILED(500, "메일 전송 실패 (서버 오류)"),
TOKEN_REISSUE_FAILED(500, "토큰 재발급 실패"),
IMAGE_UPLOAD_FAILED(500, "이미지 생성 실패ㅋ"),
FILE_UPLOAD_FAILED(500, "파일 업로드 실패ㅋ"),


TEST(400, "TEST");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.daemawiki.global.exception.h500;

import com.example.daemawiki.global.error.ErrorCode;
import com.example.daemawiki.global.error.exception.CustomException;

public class FileUploadFaildException extends CustomException {
public static final CustomException EXCEPTION = new FileUploadFaildException();

private FileUploadFaildException() {
super(ErrorCode.FILE_UPLOAD_FAILED);
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.example.daemawiki.domain.file.model.FileDetail;
import com.example.daemawiki.domain.file.model.type.FileType;
import com.example.daemawiki.domain.file.repository.FileRepository;
import com.example.daemawiki.global.exception.h500.ImageUploadFaildException;
import com.example.daemawiki.global.exception.h500.FileUploadFaildException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.buffer.DataBufferUtils;
import org.springframework.http.MediaType;
Expand Down Expand Up @@ -80,7 +80,7 @@ public Mono<File> uploadObject(FilePart filePart, String fileType) {

return s3AsyncClient.completeMultipartUpload(completeRequest);
})
.onErrorMap(e -> ImageUploadFaildException.EXCEPTION);
.onErrorMap(e -> FileUploadFaildException.EXCEPTION);
});
})
.flatMap(response -> createFile(key, filename, type, fileType));
Expand Down

0 comments on commit c029fc8

Please sign in to comment.