<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div>The signature for dets:insert_new is<br><br> insert(Name, Objects) -> ok | {error, Reason}<br><br></div>However, in my use case, I'm using a hash of the value as the key. So I thought I'd switch to using insert_new because that might be slightly more efficient (no need to update stored value).<br>
<br></div>But the signature for insert_new is<br><br> insert_new(Name, Objects) -> boolean()<br><br></div>In this case, false only indicates that a value for the key is already in the table. What about failure cases of insert()? <br>
<br></div>With insert() I have this code<br><br></div> case dets:insert(table, {Key,Value}) of<br></div> ok -> ok;<br></div> {error, _}=Other -> Other<br></div> end<br><br></div>With insert_new it turns to just<br>
<br></div> dets:insert_new(table, {Key,Value}),<br></div> ok.<br><br></div><div>IOW, it loses error handling.<br></div><div><br></div>Does insert_new() somehow handle any errors that could arise when calling insert()?<br clear="all">
<div><div><div><div><div><div><div><div><div><div><div><div><div><div><br>-- <br>Best regards<br>Alexei Sholik
</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>