diff options
| author | eltrac <hi@eltr.ac> | 2026-10-11 18:00:32 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-10-11 18:00:32 +0800 |
| commit | b3c915d33a67f8063ffb4ef8895523de47c9305c (patch) | |
| tree | 8558d1e01667f1e52c9d234c3fff79c6ee0d1e40 /src/weepinbell/processor | |
| parent | 4a8d667be310edbcfc5777c14d19532328dfa830 (diff) | |
proceesor, storage: better error handling; no interrupting pipeline
- print clear stack trace using timbre when capturing exceptions
- don't pass nil to url/normalize; if url/normalize gets a nil, instead
of NPE, it now returns an empty string
- capture exceptions in processor pipeline to keep it from dying
- http.downloader now checks response status instead of blindly
downloading anything
Diffstat (limited to 'src/weepinbell/processor')
| -rw-r--r-- | src/weepinbell/processor/facade.clj | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/weepinbell/processor/facade.clj b/src/weepinbell/processor/facade.clj index 9acea16..224c739 100644 --- a/src/weepinbell/processor/facade.clj +++ b/src/weepinbell/processor/facade.clj @@ -35,14 +35,18 @@ (do
(timbre/info "webmention found in queue, processing.")
((:on-receive callbacks) {:webmention {:id id :source s :target t}})
- (-> {:id id
- :wm wm
- :ok? true}
- (check-storage storage)
- verify
- (clean storage callbacks)
- (wrap config)
- (write storage callbacks))
+ (try
+ (-> {:id id
+ :wm wm
+ :ok? true}
+ (check-storage storage)
+ verify
+ (clean storage callbacks)
+ (wrap config)
+ (write storage callbacks))
+ (catch Exception e
+ (timbre/error "unexpceted exception in pipeline: " (.getMessage e))
+ (timbre/debug e)))
(recur (<! wmc))))))
;; return a function that stops the loop
(fn [] (put! wmc {:stop? true}))))
|
