startig with the Network Service layer for getting JSON and dealing with errors.

Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
Matt Bruce 2025-01-20 16:49:52 -06:00
parent a81045e427
commit 7f2e03ed6b

View File

@ -0,0 +1,25 @@
//
// NetworkService.swift
// EmployeeDirectory
//
// Created by Matt Bruce on 1/20/25.
//
import Foundation
public enum NetworkServiceError: Error {
/// The response from the server was invalid (e.g., non-200 status code or malformed URL).
case invalidResponse
/// The url giving is invalid or malformed
case invalidURL
/// The data received was invalid or could not be decoded.
case decodingError(DecodingError)
/// A network-related error occurred.
case networkError(URLError)
/// An unexpected, uncategorized error occurred.
case unknownError(Error)
}