Skip to content
This repository

undefined method `log_connection_exception' #22

Open
ledowong opened this Issue · 6 comments

5 participants

Leonardo Wong Rebecca Nesson Matt Jankowski Vinod Chandru Michael Durrant
Leonardo Wong

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/will_paginate/lib/will_
paginate/finder.rb:170:in method_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: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: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:in each'
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:in call'
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:in each'
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:in invoke_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:in invoke_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:in invoke_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:in each'
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:in standard_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:in run'
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:in run'
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:19

In 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.

Rebecca Nesson

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.

Matt Jankowski

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.

Rebecca Nesson

Good suggestion. Thanks.

Vinod Chandru

Submitted a pull request changing it to a class method, since I encountered this same issue. ( #27 )

Michael Durrant

I encountered this today (Jan 30th 2012)

Vinod Chandru

@durrantm #27 was merged in today. The latest version should not result in this issue and the exception should be raised properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.