Do not die when initializing the watermarker#4138
Conversation
📝 WalkthroughWalkthroughThe Watermarker constructor's initialization logic is now wrapped in a try-catch block that handles any Throwable exceptions. Exceptions occurring during watermark checks are logged via Log::error and execution continues, while preserving existing early return behavior within the protected try block. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/Image/Watermarker.php (1)
45-45: Use structured exception context in logger call.
Log::error(..., [$t])stores the throwable under a numeric key. Prefer['exception' => $t]so handlers consistently capture stack/context.Proposed patch
- } catch (\Throwable $t) { - Log::error('Failed to initialize Watermarker', [$t]); + } catch (\Throwable $t) { + Log::error('Failed to initialize Watermarker', ['exception' => $t]); }
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
Summary by CodeRabbit