raft: remove panic and return default err