-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
48 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// AuthError.swift | ||
// KkuMulKum | ||
// | ||
// Created by 이지훈 on 7/19/24. | ||
// | ||
|
||
import Foundation | ||
|
||
enum NetworkError: Error { | ||
case invalidImageFormat | ||
case imageSizeExceeded | ||
case userNotFound | ||
case decodingError | ||
case networkError | ||
case unknownError(String) | ||
|
||
var message: String { | ||
switch self { | ||
case .invalidImageFormat: | ||
return "이미지 확장자는 jpg, png, webp만 가능합니다." | ||
case .imageSizeExceeded: | ||
return "이미지 사이즈는 5MB를 넘을 수 없습니다." | ||
case .userNotFound: | ||
return "유저를 찾을 수 없습니다." | ||
case .decodingError: | ||
return "데이터 디코딩 중 오류가 발생했습니다." | ||
case .networkError: | ||
return "네트워크 오류가 발생했습니다." | ||
case .unknownError(let message): | ||
return message | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters