title: before action method not working after add exception in rails
body: <p>af first i'm newbie in rails . I have project witch have multiple controller , i added new method to my cotroller to get my logs but after that rails server display 401 error .
  this is my authentiocation</p>
  <pre class="lang-rb prettyprint-override"><code>before_action :authenticate_staff, except: %i[webhook public_track tracking_hook]
  </code></pre>
  <p>and this is my method</p>
  <pre class="lang-rb prettyprint-override"><code>def tracking_hook
    byebug
    Rails.logger.info 'Controller: Tracking, Action: tracking, role: customer, ' \
                      &quot;barcodeId #{tracking_params['barcode']}, message: start request&quot;
    ::TrackingHookWorker.perform_async(tracking_params)
    Rails.logger.info 'Controller: Tracking, Action: tracking, role: customer, ' \
                      &quot;barcodeId #{tracking_params['barcode']}, message: end request&quot;
    render json: {success: true}
  rescue StandardError =&gt; e
    byebug
    Rails.logger.error('Controller: Tracking, Action: tracking, role: customer, ' \
                            &quot;barcodeId #{tracking_params['barcode']}, message: &quot; + e.to_s)
    render json: {success: true}
  
  end
  </code></pre>
  <p>my problem is befor i added this method to my project every thing is fine but after that it gaves me error 401 , i use byebug and find if i change before action method to</p>
  <pre class="lang-rb prettyprint-override"><code>skip_before_action :authenticate_staff, only: %i[webhook public_track tracking_hook]
  
  </code></pre>
  <p>everything goes fine . I can't understand what happen to my project and what should i do ?
  sorry for my terrible english.</p>