Class RaygunClient


  • public class RaygunClient
    extends Object
    This is the main sending object that you instantiate with your API key There should only be on RaygunClient per process/thread/request as it stores state about the said process/thread/request
    • Constructor Detail

      • RaygunClient

        public RaygunClient​(String apiKey)
    • Method Detail

      • setRaygunConnection

        public void setRaygunConnection​(RaygunConnection raygunConnection)
      • getMachineName

        protected String getMachineName()
      • setVersion

        public void setVersion​(String version)
      • setVersionFrom

        public void setVersionFrom​(Class getVersionFrom)
      • send

        public int send​(Throwable throwable)
        Use this method to send a handled exception to Raygun
        Parameters:
        throwable - a handled exception
        Returns:
        send status code
      • send

        public int send​(Throwable throwable,
                        Map data)
      • sendUnhandled

        public int sendUnhandled​(Throwable throwable)
        Use this method to send an unhandled exception to Raygun (it will be tagged as an unhandled exception)
        Parameters:
        throwable - an unhandled exception
        Returns:
        send status code
      • sendUnhandled

        public int sendUnhandled​(Throwable throwable,
                                 Map data)
      • getDataForError

        protected Map getDataForError​(Map errorData)
      • shouldProcessBreadcrumbLocation

        public boolean shouldProcessBreadcrumbLocation()
      • shouldProcessBreadcrumbLocation

        public void shouldProcessBreadcrumbLocation​(boolean shouldProcessBreadcrumbLocation)
        BEWARE: setting this to true could seriously degrade performance of your application
        Parameters:
        shouldProcessBreadcrumbLocation - true to process breadcrumpr location
      • withTag

        public RaygunClient withTag​(String tag)
        These tags will be added to all errors sent from this instance of the client
        Parameters:
        tag - the tag to be associated with the errors
        Returns:
        client
      • setTags

        public void setTags​(Set<String> tags)
      • getData

        public Map<?,​?> getData()
      • setData

        public void setData​(Map<?,​?> data)
      • withData

        public RaygunClient withData​(Object key,
                                     Object value)
        This data will be added to all errors sent from this instance of the client
        Parameters:
        key - the key of the key-value pair
        value - the value of the key-value pair
        Returns:
        client
      • ClearBreadcrumbs

        public void ClearBreadcrumbs()