title: How Do I Handle Errors Globally in TestCafe
body: <p>I've built up a Page Object Model for my TestCafe project in typescript. I'm finding the repetitive nature of try/catch in every method to be overkill. I always want the errors to be logged with winston.</p>
  
  <p>Is there a suggested way to handle errors globally? Here's an example page:</p>
  
  <pre><code>import { Selector, t } from "testcafe";
  import logger from 'logger';
  
  export default class DocumentQueryPage {
      path: string;
      queryDocumentsButton: Selector;
  
      constructor() {
          this.path = "#/records/query";
  
          this.queryDocumentsButton = Selector('button.btn-request-records');
      }
  
      async go(): Promise&lt;void&gt; {
          try {
              await t.navigateTo(this.path)
          }
          catch (err) {
              logger.error(err)
          }
      }
  
      async selectFirstQuery(): Promise&lt;void&gt; {
          try {
              await t.navigateTo(this.path)
          }
          catch (err) {
              logger.error(err)
          }
      }
  }
  </code></pre>