title: Using try catch in watch of Vue.js
body: <p>I have a textarea. I'am coding an object. I want to control this data that is available for syntax. My html code is:</p>
  <pre><code>&lt;b-form-textarea
     id=&quot;textarea-state&quot;
     v-model=&quot;data.deviceData&quot;
     :state=&quot;codingControl == true&quot;
     rows=&quot;8&quot;
   /&gt;
  </code></pre>
  <p>I'm coding this below object in my <code>b-form-textarea</code> component.</p>
  <pre><code>{
     &quot;device_id&quot;:&quot;&quot;,
     &quot;outputs&quot;:[false,false,false,false,false,false,false,false],
     &quot;inputs&quot;:[false,false,false,false,false,false,false,false]
  }
  </code></pre>
  <p>And I watch this object is available for syntax or not. But <code>try catch</code> can not catch the error. How can I catch this error, if that object has a syntax error?</p>
  <pre><code>watch: {
     data: {
        handler(val) {
          try {
            this.datas = JSON.parse(val.deviceData)
            this.codingControl = true
          } catch (error) {
            this.datas = JSON.parse(val.deviceData)
            this.codingControl = false
          }
        },
        deep: true,
      },
  }
  </code></pre>
  <p>By the way watch is runnig. single problem <code>try catch</code> can not run.</p>