<p dir="ltr">An empty result to a db query is not an error.</p>
<p dir="ltr">Sergej</p>
<div class="gmail_quote">On Feb 7, 2016 7:38 PM, <<a href="mailto:lloyd@writersglen.com">lloyd@writersglen.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I have this mnesia query:<br>
<br>
<br>
get_note(ID) -><br>
Query =<br>
fun() -><br>
mnesia:read({?TABLE, ID})<br>
end,<br>
{atomic, Results} = mnesia:transaction(Query),<br>
Results.<br>
<br>
It returns either a list containing one or more valid records or an empty list.<br>
<br>
Would it be better to return something like:<br>
<br>
{ok, Records} | {error, data_not_found}<br>
<br>
Thanks,<br>
<br>
LRP<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>