Error handling

//struct error type
struct StructErrorError {
    var message: String
}

//class error type
@MainActor
class ClassErrorError {
    var message: String

    init(message: String) {
        self.message = message
    }
}

//enum error type
enum EnumErrorError {
    case accessDenied, fileNotFound
}

throw StructError(message: "Struct error")

throw ClassError(message: "Class error")

throw EnumError.accessDenied