Interface ErrorReporter


public interface ErrorReporter
Receives the errors MyPet catches, so they can be reported somewhere useful.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Stops reporting and flushes anything pending.
    void
    Starts reporting.
    void
    sendError(Throwable t, String... context)
    Reports one error.
  • Method Details

    • onEnable

      void onEnable()
      Starts reporting. Called as MyPet enables.
    • onDisable

      void onDisable()
      Stops reporting and flushes anything pending. Called as MyPet disables.
    • sendError

      void sendError(Throwable t, String... context)
      Reports one error.

      This is the preferred route: it carries the context lines as breadcrumbs. An implementation that also captures logged exceptions must treat a throwable passed here as already reported and must not capture it a second time when it is logged afterwards. A caller that both reports and logs an error therefore has to call this method before logging it (as ErrorUtil does), so the report is recorded before any log-based capture sees it.

      Parameters:
      t - the error to report
      context - extra lines describing what MyPet was doing