+ If this problem persists, please contact us on
+ <%= link_to "Slack", "https://hackclub.slack.com", class: "text-primary hover:underline", target: "_blank" %>.
+
+
+
diff --git a/config/application.rb b/config/application.rb
index 2f1689f..0891d40 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -53,5 +53,6 @@ module Harbor
config.middleware.use HtmlCompressor::Rack
config.middleware.use Rack::Attack
+ config.exceptions_app = routes
end
end
diff --git a/config/honeybadger.yml b/config/honeybadger.yml
deleted file mode 100644
index 055cd6f..0000000
--- a/config/honeybadger.yml
+++ /dev/null
@@ -1,36 +0,0 @@
----
-# For more options, see https://docs.honeybadger.io/lib/ruby/gem-reference/configuration
-
-api_key: 'hbp_IET1u9vKrC7IWjt45arAsfguTrGSFR1bSxEq'
-
-# The environment your app is running in.
-env: "<%= Rails.env %>"
-
-# The absolute path to your project folder.
-root: "<%= Rails.root.to_s %>"
-
-# Honeybadger won't report errors in these environments.
-development_environments:
-- test
-- development
-- cucumber
-- production # temporary disable
-
-# By default, Honeybadger won't report errors in the development_environments.
-# You can override this by explicitly setting report_data to true or false.
-# report_data: true
-
-# The current Git revision of your project. Defaults to the last commit hash.
-# revision: null
-
-# Enable verbose debug logging (useful for troubleshooting).
-debug: false
-
-# Ignore noisy errors
-exceptions:
- ignore:
- - GoodJob::ActiveJobExtensions::Concurrency::ConcurrencyExceededError
-
-# disable insights lol
-insights:
- enabled: false
diff --git a/config/initializers/autotuner.rb b/config/initializers/autotuner.rb
index 2a99318..999cd38 100644
--- a/config/initializers/autotuner.rb
+++ b/config/initializers/autotuner.rb
@@ -2,4 +2,10 @@
# between 0 and 1.0 to sample on a portion of instances.
Autotuner.enabled = true
-# The rest is handled by the honeybadger gem.
+Autotuner.reporter = proc do |report|
+ Sentry.capture_message(
+ "Autotuner Suggestion",
+ level: :info,
+ extra: { report: report.to_s }
+ )
+end
diff --git a/config/initializers/honeybadger.rb b/config/initializers/honeybadger.rb
deleted file mode 100644
index 95d0fca..0000000
--- a/config/initializers/honeybadger.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-# Honeybadger programmatic error filtering to prevent rate limit exhaustion
-Honeybadger.configure do |config|
- @error_counts = Hash.new { |hash, key| hash[key] = { hourly: [], daily: [] } }
-
- # Rate limiting configuration
- MAX_ERRORS_PER_HOUR = 10
- MAX_ERRORS_PER_DAY = 50
-
- config.before_notify do |notice|
- if notice.error_class == "Norairrecord::Error" && notice.error_message&.include?("HTTP 429")
- return false
- end
-
- error_index = generate_error_index notice
-
- should_ignore = rate_limit_exceeded? error_index
-
- record_error_occurrence error_index unless should_ignore
-
- !should_ignore
- end
-
- private
-
- def generate_error_index(notice)
- if notice.backtrace&.any?
- first_stack_line = notice.backtrace.first
- "#{notice.error_class}:#{first_stack_line}"
- else
- controller = notice.context[:controller]
- action = notice.context[:action]
- "#{notice.error_class}:#{controller}:#{action}"
- end
- end
-
- def rate_limit_exceeded?(error_index)
- now = Time.current
- one_hour_ago = now - 1.hour
- one_day_ago = now - 1.day
-
- @error_counts[error_index][:hourly].reject! { |timestamp| timestamp < one_hour_ago }
- @error_counts[error_index][:daily].reject! { |timestamp| timestamp < one_day_ago }
-
- hourly_count = @error_counts[error_index][:hourly].size
- daily_count = @error_counts[error_index][:daily].size
-
- hourly_count >= MAX_ERRORS_PER_HOUR || daily_count >= MAX_ERRORS_PER_DAY
- end
-
- def record_error_occurrence(error_index)
- now = Time.current
- @error_counts[error_index][:hourly] << now
- @error_counts[error_index][:daily] << now
- end
-end
diff --git a/config/routes.rb b/config/routes.rb
index 5a5439a..65c8cd8 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -205,4 +205,10 @@ Rails.application.routes.draw do
# SEO routes
get "/sitemap.xml", to: "sitemap#sitemap", defaults: { format: "xml" }
+
+ # fuck ups
+ match "/400", to: "errors#bad_request", via: :all
+ match "/404", to: "errors#not_found", via: :all
+ match "/422", to: "errors#unprocessable_entity", via: :all
+ match "/500", to: "errors#internal_server_error", via: :all
end
diff --git a/public/400.html b/public/400.html
deleted file mode 100644
index b7c2b3e..0000000
--- a/public/400.html
+++ /dev/null
@@ -1,126 +0,0 @@
-
-
-
-
-
-
- The server cannot process the request due to a client error (400 Bad Request)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
The request you sent is invalid or corrupt. If you're the application owner check the logs for more information.
-
- Hey! Congrats! You probably just found a bug!
- This is the Hackatime v2 beta, after all.
- Can you take a screenshot of this page and email max@hackclub.com
- describing what you did to get here? Please make sure the current URL
- is visible in the screenshot.
The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved. If you're the application owner check the logs for more information.
-
- Hey! Congrats! You probably just found a bug!
- This is the Hackatime v2 beta, after all.
- Can you take a screenshot of this page and email max@hackclub.com describing what you did to get here?
- Also please make sure the current URL is visible in the screenshot.
-
Your browser is not supported. Please upgrade to a modern browser, such as the latest version of Chrome, Firefox, Safari, or Edge.
-
- Hey! Congrats! You probably just found a bug!
- This is the Hackatime v2 beta, after all.
- Can you take a screenshot of this page and email max@hackclub.com
- describing what you did to get here? Please make sure the current URL
- is visible in the screenshot.
- Hey! Congrats! You probably just found a bug!
- This is the Hackatime v2 beta, after all.
- Can you take a screenshot of this page and email max@hackclub.com
- describing what you did to get here? Please make sure the current URL
- is visible in the screenshot.