Skip to content

Commit f992231

Browse files
committed
Ignore json parser errors
This is often HTML from error pages or misconfigured servers
1 parent ebd226f commit f992231

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/jobs/application_job.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ class ApplicationJob < ActiveJob::Base
88
# Retry on HTTP errors
99
retry_on HTTPX::HTTPError, wait: HTTP_5XX_RETRY_DELAY
1010

11+
# We ignore invalid JSON (which is often just HTML from error pages and/or misconfigured web servers
12+
discard_on JSON::ParserError
13+
1114
# Most jobs are safe to ignore if the underlying records are no longer available
1215
discard_on ActiveJob::DeserializationError
1316
end

0 commit comments

Comments
 (0)