Interface ErrorApi


  • public interface ErrorApi
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void noticeError​(java.lang.String message)
      Notice an error and report it to New Relic.
      default void noticeError​(java.lang.String message, boolean expected)
      Notice an error and report it to New Relic.
      default void noticeError​(java.lang.String message, java.util.Map<java.lang.String,​?> params)
      Notice an error and report it to New Relic.
      void noticeError​(java.lang.String message, java.util.Map<java.lang.String,​?> params, boolean expected)
      Notice an error and report it to New Relic.
      default void noticeError​(java.lang.Throwable throwable)
      Report an exception to New Relic.
      default void noticeError​(java.lang.Throwable throwable, boolean expected)
      Report an exception to New Relic.
      default void noticeError​(java.lang.Throwable throwable, java.util.Map<java.lang.String,​?> params)
      Notice an exception and report it to New Relic.
      void noticeError​(java.lang.Throwable throwable, java.util.Map<java.lang.String,​?> params, boolean expected)
      Notice an exception and report it to New Relic.
      void setErrorGroupCallback​(ErrorGroupCallback errorGroupCallback)
      Registers an ErrorGroupCallback that's used to generate a grouping key for the supplied error.
    • Method Detail

      • noticeError

        default void noticeError​(java.lang.Throwable throwable,
                                 java.util.Map<java.lang.String,​?> params)
        Notice an exception and report it to New Relic. If this method is called within a transaction, the exception will be reported with the transaction when it finishes. If it is invoked outside of a transaction, a traced error will be created and reported to New Relic. If noticeError is invoked multiple times while in a transaction, only the last error will be reported.

        Note: The key and value pairs in custom parameters params will be dropped or modified in the traced error if the key or value, each, cannot be encoded in 255 bytes. If key or value is over this limit, the behavior will be the same as defined in addCustomParameter.

        Parameters:
        throwable - The throwable to notice and report.
        params - Custom parameters to include in the traced error. May be null.
        Since:
        1.3.0
      • noticeError

        default void noticeError​(java.lang.Throwable throwable)
        Report an exception to New Relic.
        Parameters:
        throwable - The throwable to report.
        Since:
        1.3.0
        See Also:
        noticeError(Throwable, Map)
      • noticeError

        default void noticeError​(java.lang.String message,
                                 java.util.Map<java.lang.String,​?> params)
        Notice an error and report it to New Relic. If this method is called within a transaction, the error message will be reported with the transaction when it finishes. If it is invoked outside of a transaction, a traced error will be created and reported to New Relic. If noticeError is invoked multiple times while in a transaction, only the last error will be reported.

        Note: The key and value pairs in custom parameters params will be dropped or modified in the traced error if the key or value, each, cannot be encoded in 255 bytes. If key or value is over this limit, the behavior will be the same as defined in addCustomParameter.

        Parameters:
        message - The error message to be reported.
        params - Custom parameters to include in the traced error. May be null.
        Since:
        1.3.0
      • noticeError

        default void noticeError​(java.lang.String message)
        Notice an error and report it to New Relic. If this method is called within a transaction, the error message will be reported with the transaction when it finishes. If it is invoked outside of a transaction, a traced error will be created and reported to New Relic. If noticeError is invoked multiple times while in a transaction, only the last error will be reported.
        Parameters:
        message - Message to report with a transaction when it finishes.
        Since:
        2.21.0
      • noticeError

        void noticeError​(java.lang.Throwable throwable,
                         java.util.Map<java.lang.String,​?> params,
                         boolean expected)
        Notice an exception and report it to New Relic. If this method is called within a transaction, the exception will be reported with the transaction when it finishes. If it is invoked outside of a transaction, a traced error will be created and reported to New Relic. If noticeError is invoked multiple times while in a transaction, only the last error will be reported.

        Expected errors do not increment an application's error count or contribute towards its Apdex score.

        Note: The key and value pairs in custom parameters params will be dropped or modified in the traced error if the key or value, each, cannot be encoded in 255 bytes. If key or value is over this limit, the behavior will be the same as defined in addCustomParameter.

        Parameters:
        throwable - The throwable to notice and report.
        params - Custom parameters to include in the traced error. May be null.
        expected - true if this error is expected, false otherwise.
        Since:
        3.38.0
      • noticeError

        default void noticeError​(java.lang.Throwable throwable,
                                 boolean expected)
        Report an exception to New Relic.

        Expected errors do not increment an application's error count or contribute towards its Apdex score.

        Parameters:
        throwable - The throwable to report.
        expected - true if this error is expected, false otherwise.
        Since:
        3.38.0
        See Also:
        noticeError(Throwable, Map)
      • noticeError

        void noticeError​(java.lang.String message,
                         java.util.Map<java.lang.String,​?> params,
                         boolean expected)
        Notice an error and report it to New Relic. If this method is called within a transaction, the error message will be reported with the transaction when it finishes. If it is invoked outside of a transaction, a traced error will be created and reported to New Relic. If noticeError is invoked multiple times while in a transaction, only the last error will be reported.

        Expected errors do not increment an application's error count or contribute towards its Apdex score.

        Note: The key and value pairs in custom parameters params will be dropped or modified in the traced error if the key or value, each, cannot be encoded in 255 bytes. If key or value is over this limit, the behavior will be the same as defined in addCustomParameter.

        Parameters:
        message - The error message to be reported.
        params - Custom parameters to include in the traced error. May be null.
        expected - true if this error is expected, false otherwise.
        Since:
        3.38.0
      • noticeError

        default void noticeError​(java.lang.String message,
                                 boolean expected)
        Notice an error and report it to New Relic. If this method is called within a transaction, the error message will be reported with the transaction when it finishes. If it is invoked outside of a transaction, a traced error will be created and reported to New Relic. If noticeError is invoked multiple times while in a transaction, only the last error will be reported. Expected errors do not increment an application's error count or contribute towards its Apdex score.
        Parameters:
        message - Message to report with a transaction when it finishes.
        expected - true if this error is expected, false otherwise.
        Since:
        3.38.0
      • setErrorGroupCallback

        void setErrorGroupCallback​(ErrorGroupCallback errorGroupCallback)
        Registers an ErrorGroupCallback that's used to generate a grouping key for the supplied error. This key will be used to group similar error messages on the Errors Inbox UI. If the errorGroupCallback instance is null no grouping key will be generated.
        Parameters:
        errorGroupCallback - the ErrorGroupCallback used to generate grouping keys for errors
        Since:
        8.10.0