Open ledowong opened 13 years ago
Hi,
We set up the log_connection_exception method as a method that you can define yourself to do your error reporting. I thought we had put an empty implementation in place, but perhaps not.
In any case, the change you made to log the error you were receiving was the sort of thing we imagined people might put in the log_connection_exception method anyway.
I'm glad you're finding the plugin useful.
I think that method should be a class method where it's defined, so that it does nothing by default (instead of erroring by default) - and people can then override the class method if they need to log something. Right now it's an instance method on the app class, but it's called from a class method.
Good suggestion. Thanks.
Submitted a pull request changing it to a class method, since I encountered this same issue. ( https://github.com/PRX/apn_on_rails/pull/27 )
I encountered this today (Jan 30th 2012)
@durrantm https://github.com/PRX/apn_on_rails/pull/27 was merged in today. The latest version should not result in this issue and the exception should be raised properly.
using 0.4.2 gem
try to deliver a notification to apple, but failed, with this error:
undefined method
log_connection_exception' for #<Class:0x6cfbee8> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/base.rb:1994 :in
method_missing_without_paginate' C:/Users/Leonardo Wong/workspace/projectA/vendor/plugins/willpaginate/lib/will paginate/finder.rb:170:inmethod_missing' c:/ruby/lib/ruby/gems/1.8/gems/apn_on_rails-0.4.2/lib/apn_on_rails/app/models/ap n/app.rb:58:in
send_notifications_for_cert' c:/ruby/lib/ruby/gems/1.8/gems/apn_on_rails-0.4.2/lib/apn_on_rails/app/models/ap n/app.rb:26:insend_notifications' c:/ruby/lib/ruby/gems/1.8/gems/apn_on_rails-0.4.2/lib/apn_on_rails/app/models/ap n/app.rb:32:in
send_notifications' c:/ruby/lib/ruby/gems/1.8/gems/apn_on_rails-0.4.2/lib/apn_on_rails/app/models/ap n/app.rb:31:ineach' c:/ruby/lib/ruby/gems/1.8/gems/apn_on_rails-0.4.2/lib/apn_on_rails/app/models/ap n/app.rb:31:in
send_notifications' c:/ruby/lib/ruby/gems/1.8/gems/apn_on_rails-0.4.2/lib/apn_on_rails/tasks/apn.rak e:7 c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:incall' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
execute' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:ineach' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
execute' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:ininvoke_with_call_c hain' c:/ruby/lib/ruby/1.8/monitor.rb:242:in
synchronize' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:ininvoke_with_call_c hain' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in
invoke' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:ininvoke_task' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:ineach' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exceptio n_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in
top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:inrun' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
standard_exceptio n_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:inrun' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 c:/ruby/bin/rake:19:in
load' c:/ruby/bin/rake:19In app.rb, i comment line 58, and put "puts e.message" there, it shows: 259 out of char range
I know my message(alert) is too long, I will fix that, just try to report the code error here.
Thanks for this nice plugin. Save me a lot of time.