Error Handling (for function that returns type [String])

How do I allow for a function that is returning a specific type (such as type [String]) to return an error message if the inputted string argument is an empty string?

I was thinking of using an if-else setup within the main body of the function, where the If part checks to see if the string argument is empty or not, then having the Else part throw some sort of error to let the user know that they cannot enter an empty string.

I’ve looked at a handful of articles; the throws options weren’t working when I tried it, and I don’t think a do-catch would work for this. Thoughts?

func toSubstringArray(string: String) -> [String] {
  let charArray: [Character] = Array(string.lowercased())
  var substringArray: [String] = []
  for index in 0...(charArray.count-1) {
  return substringArray

One low level solution would be to simply print out a message to the user, and then return an empty char array [""]. You’d need to use a if…else block, and return the [""] to avoid getting a return needed error. To check the length of a string (which is one way to tell if it’s empty or not), .count can be used.