this is not a good api (it prevents extensibility, requires handling errors twice to be safe - once on user side, once internally - and so on); just cast it