TelemetryError

Enum TelemetryError 

Source
pub enum TelemetryError {
    Database(Error),
    Http(Error),
    Json(Error),
    InvalidConfig(String),
    Auth(String),
    RateLimitExceeded {
        retry_after: u64,
    },
    ServerError {
        status: u16,
        message: String,
    },
    MaxRetriesExceeded,
    InvalidSchema(String),
    Io(Error),
    MachineId(String),
    Other(String),
}
Expand description

Errors that can occur during telemetry operations

Variants§

§

Database(Error)

SQLite database error

Common causes:

  • Database file is locked (another process using it)
  • Insufficient permissions to write to database file
  • Disk full or quota exceeded
  • Corrupted database file

Suggestions:

  • Check file permissions on the database directory
  • Ensure no other process is using the database
  • Try deleting the database file to recreate it (data will be lost)
§

Http(Error)

HTTP request error

Common causes:

  • Network connectivity issues
  • Invalid endpoint URL
  • Server is down or unreachable
  • DNS resolution failure
  • SSL/TLS certificate issues

Suggestions:

  • Check your internet connection
  • Verify the endpoint URL is correct
  • Check if the server is accessible via curl/ping
§

Json(Error)

JSON serialization/deserialization error

Common causes:

  • Invalid JSON structure
  • Schema version mismatch
  • Missing required fields
  • Type conversion errors

Suggestions:

  • Check that SDK and server versions are compatible
  • Verify custom event data is valid JSON
§

InvalidConfig(String)

Invalid configuration

Suggestions:

  • Review the configuration documentation
  • Ensure all required fields are provided
  • Check that UUIDs are in valid format
§

Auth(String)

Authentication error

Common causes:

  • Invalid or expired token
  • Incorrect HMAC secret
  • Token doesn’t have required permissions

Suggestions:

  • Verify your token and secret are correct
  • Generate a new token if the current one is expired
  • Check that the token has sync permissions
§

RateLimitExceeded

Rate limit exceeded

You’ve exceeded the rate limit for your tier.

Suggestions:

  • Wait the specified duration before retrying
  • Reduce event frequency
  • Batch events together
  • Consider upgrading to a higher tier

Fields

§retry_after: u64

Seconds to wait before retrying

§

ServerError

Server error with status code

The server encountered an error processing your request.

Suggestions:

  • If 5xx error, retry the request after a delay
  • If 4xx error, check your request parameters
  • Check server status page if available

Fields

§status: u16

HTTP status code

§message: String

Error message from server

§

MaxRetriesExceeded

Maximum retries exceeded

The operation failed after multiple retry attempts.

Common causes:

  • Persistent network issues
  • Server is down
  • Invalid credentials

Suggestions:

  • Check server health and network connectivity
  • Verify authentication credentials
  • Enable offline mode to queue events locally
§

InvalidSchema(String)

Invalid event schema

The event structure doesn’t match the expected schema.

Suggestions:

  • Ensure SDK version is compatible with server
  • Check that required event fields are present
  • Review event schema documentation
§

Io(Error)

IO error

Common causes:

  • File or directory doesn’t exist
  • Insufficient permissions
  • Disk full

Suggestions:

  • Check file/directory exists and is accessible
  • Verify write permissions
  • Ensure sufficient disk space
§

MachineId(String)

Machine ID error

Failed to generate or retrieve a unique machine identifier.

Common causes:

  • System doesn’t have machine UUID available
  • Insufficient permissions to access machine ID

Suggestions:

  • This is usually safe to ignore (fallback ID will be used)
  • On Docker/CI, this is expected behavior
§

Other(String)

Generic error

Implementations§

Source§

impl TelemetryError

Source

pub fn is_retryable(&self) -> bool

Check if the error is retryable

Source

pub fn invalid_config(field: &str, reason: &str) -> Self

Create a helpful InvalidConfig error with context

Source

pub fn invalid_uuid(field: &str, value: &str) -> Self

Create a helpful InvalidConfig error for UUID validation

Source

pub fn missing_field(field: &str) -> Self

Create a helpful error for missing required fields

Trait Implementations§

Source§

impl Debug for TelemetryError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for TelemetryError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for TelemetryError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for TelemetryError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for TelemetryError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for TelemetryError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for TelemetryError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more