This shouldn't panic, but return an error.