Return err instead of raising it