title: How to detect an error in item creation on the client side (App Maker)
body: <p>I am creating an app to store schedules and I do not want two schedules with the same date. To combat this I added this code (javascript) to the <code>onBeforeCreate()</code> and <code>onBeforeSave()</code> events.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var query = app.models.DataSource.newQuery(); // New query
  
  query.filters.date._equals = record.date; //Search for a record that has the same 
  
  if (query.run().length) {
    throw new Error("There is already a schedule on that date"); // Throw an error
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>This works great to prevent the duplicate entries, but how would I go about detecting this on the client side and reporting it to the user?</p>
  
  <p>Its probably a quick fix but any input would be greatly appreciated :)</p>
  
  <p>Thanks!!</p>