-
-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not log "process_action.action_controller" event. ArgumentError: wrong number of arguments (0 for 1)
when validation error occured
#126
Comments
Should use |
Any workarounds? I have the same issue with logger. |
I will look into this the coming weekend. Thanks for the input @sakuro |
I looked into it, But it would completely ignore the |
AR seems that it registers AR specific exceptions to the mappings, right? |
I expected that too after reading the code, but when executing the code with tests there is no AR specific mapping in the exception wrapper. Maybe this just gets loaded when you run rails as an "actual" instance? |
We have the same issue in our production system. Can I help with any info? Any progress here? Thanks a lot!!! Example stacktrace can be found here: https://gist.githubusercontent.com/andywenk/2aa6e974e637ad93bde9/raw/ab0fdf9c718f5626666252c90df3db9fbcb9e680/gistfile1.txt |
Sorry I am currently a bit down under. We are happy about a pull request that would fix this. |
I'm looking into this now. Hold tight. |
This resolves #126 by not attempting to create exception classes. A couple of points no less: 1. The `ActiveRecord` specific exceptions _are_ loaded and merged when its railtie is loaded. Our tests do not load `ActiveRecord` so while they don't exist in our context, they _will_ be around in your garden variety rails application. 2. We essentially replicate what the `ExceptionWrapper` was doing for us, but by leveraging `Rack::Utils.status_code` we avoid the need to create an instance of the actual exception class. Thus avoiding the problems experienced creating exceptions that expect initializer arguments.
Issue
In bug fix of the issue #110 , you had modified following this.
https://github.com/roidrage/lograge/pull/112/files#diff-d3a7c7717409a1c1353805f9579b980bR64
But, in
get_error_status_code
method, there isexception_object = exception.constantize.new
.https://github.com/roidrage/lograge/pull/112/files#diff-d3a7c7717409a1c1353805f9579b980bR71
If the exception requires arguments (for example, as of
ActiveRecord::RecordInvalid
),exception_object = exception.constantize.new
throwArgumentError: wrong number of arguments
.Such errors cause
Could not log "process_action.action_controller" event. ArgumentError: wrong number of arguments (0 for 1)
in 85 line ofactivesupport-4.2.0/lib/active_support/log_subscriber.rb
.Environments
0.3.2
4.2.0
2.2.2p95 (2015-04-13 revision 50295)
The text was updated successfully, but these errors were encountered: