more readable error for TO_BASE_CAST