Pool.starmap exception raising

The following code is only handling first exception while carrying on with rest of the code.

The problem is solved when we add try except to func.

What is the reason for the same ? Any documentation would be helpful

from multiprocessing.pool import ThreadPool

class SQLQueryError(Exception):
  def init(self, message):
    self.message = message
    super().init(f"SQL query error: {message}")

def solve(args):
  with ThreadPool(len(args)) as pool:
    try:
      return pool.starmap(func,args)
    except Exception as e:
      print(e)

def func(a, b):
  if(a==“12” or a==“23” or b == “Work”):
    raise SQLQueryError( f"Table does not exist {a} and {b}")

li = [(“12”, “Hello”), (“23”, “World”), (“12”, “Hospital”),(“7”,“Work”)]
solve(li)

Output: -
SQL query error: Table does not exist 12 and Hello