fix: ActiveRecord::RecordNotFound Couldn't find Channel::WebWidget (#6523)
* fix: resucue ActiveRecord::RecordNotFound for webwidget controller * chore: add rails.log
This commit is contained in:
@@ -18,6 +18,9 @@ class WidgetsController < ActionController::Base
|
||||
|
||||
def set_web_widget
|
||||
@web_widget = ::Channel::WebWidget.find_by!(website_token: permitted_params[:website_token])
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
Rails.logger.error('web widget does not exist')
|
||||
render json: { error: 'web widget does not exist' }, status: :not_found
|
||||
end
|
||||
|
||||
def set_token
|
||||
|
||||
Reference in New Issue
Block a user