Commit 78d458489de8843b5fc9d87abe30e4315f7f235e
1 parent
3dd2b47e
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Palitive for the broken API log
Showing
1 changed file
with
8 additions
and
1 deletions
Show diff stats
lib/noosfero/api/api.rb
| @@ -12,6 +12,13 @@ module Noosfero | @@ -12,6 +12,13 @@ module Noosfero | ||
| 12 | use GrapeLogging::Middleware::RequestLogger, { logger: logger } | 12 | use GrapeLogging::Middleware::RequestLogger, { logger: logger } |
| 13 | 13 | ||
| 14 | rescue_from :all do |e| | 14 | rescue_from :all do |e| |
| 15 | + # Many brave warriors have fallen in the battle of fixing the API log | ||
| 16 | + # Please, don't remove these 2 lines until the API log problem has | ||
| 17 | + # been PROPERLY fixed by our savior!!! | ||
| 18 | + # Otherwise we will have no clue of what went wrong in the API | ||
| 19 | + puts "API error during processing: #{$!}" | ||
| 20 | + puts "Backtrace:\n\t#{e.backtrace.join("\n\t")}" | ||
| 21 | + # Thanks! | ||
| 15 | logger.error e | 22 | logger.error e |
| 16 | end | 23 | end |
| 17 | 24 | ||
| @@ -61,4 +68,4 @@ module Noosfero | @@ -61,4 +68,4 @@ module Noosfero | ||
| 61 | end | 68 | end |
| 62 | end | 69 | end |
| 63 | end | 70 | end |
| 64 | -end | 71 | -end |
| 72 | +end | ||
| 65 | \ No newline at end of file | 73 | \ No newline at end of file |