From 9d1f2af3f558b095934bc27186b1c47a863f7621 Mon Sep 17 00:00:00 2001 From: Jungpyo Hong <54448459+jphong1111@users.noreply.github.com> Date: Wed, 19 May 2021 23:17:13 -0500 Subject: [PATCH] Update AppError.swift --- .../Error Manager/AppError.swift | 41 +++++++++++++++---- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/Helper/Network Layer/Error Manager/AppError.swift b/Helper/Network Layer/Error Manager/AppError.swift index 9d865fc..0b34a69 100644 --- a/Helper/Network Layer/Error Manager/AppError.swift +++ b/Helper/Network Layer/Error Manager/AppError.swift @@ -5,33 +5,56 @@ // // Created by JungpyoHong on 5/4/21. // + import Foundation enum AppError: Error { case badUrl - case badResponse case serverError + case badResponse case noData case parseError case badRequest case genericError(String) + case parametersNil + case encodingFail + case unauthorizedLocationAccess + case copyError var errorMessage: String { switch self { case .badUrl: - return "" - case .badResponse: - return "" + return "URL is not valid" + case .serverError: - return "" + return "Server Error" + + case .badResponse: + return "Bad HTTP response" + case .noData: - return "" - case .badRequest: - return "" + return "No data found" + case .parseError: - return "" + return "Parsing Error" + + case .badRequest: + return "Bad Request" + case .genericError(let message): return message + + case .parametersNil: + return "Parameters were nil." + + case .encodingFail: + return "Parameter encoding fail." + + case .unauthorizedLocationAccess: + return "Unauthorized Location Access" + case .copyError: + return "Unable to copy file" } } } +