-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Occasionally I get the following stack trace from requests passing through grape-middleware-lograge:
error: "can't convert nil into an exact number",
"/opt/delta_core/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/core_ext/time/calculations.rb:240:in-'", "/opt/delta_core/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/core_ext/time/calculations.rb:240:inminus_with_duration'",
"/opt/delta_core/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/core_ext/time/calculations.rb:251:inminus_with_coercion'", "/opt/delta_core/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:61:induration'",
"/opt/delta_core/shared/bundle/ruby/2.3.0/bundler/gems/grape-middleware-lograge-3daaa11d7114/lib/grape/middleware/lograge.rb:28:in `block in before'"
Stemming from ActiveSupport::Notifications::Event being initialized with a nil start time from ActiveSupport::Notifications.subscribe('sql.active_record'). The error can be prevented by making sure the value is initialized.