-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin error logging #19
Conversation
); | ||
|
||
Event::fire(new PluginErrorReceivedEvent($pluginError)); | ||
return response('', 204); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure a 204 makes sense? The response should acknowledge the creation of an event (201) or confirm all is okay (200).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to 201
*/ | ||
public function handle(PluginErrorReceivedEvent $errorReceivedEvent) : bool | ||
{ | ||
Bugsnag::notifyException(new PluginErrorException('New plugin error reported')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't required; Bugsnag will catch any exception that bubbles up to the ExceptionHandler
class.
use App\Events\PluginErrorReceivedEvent; | ||
use App\Models\PluginError\PluginError; | ||
|
||
class RecordPluginErrorInBugsnagTest extends BaseUnitTestCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this test class has much value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a stickler for high test coverage, that's why it exists xD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If my Bugsnag comment above is addressed it should make this test (and the event) redundant
As discussed, we'll likely need to flesh this out a tad more. |
Close #18
Allows the plugin to post us JSON data regarding its state, so that we have debugging information.