throwError static method

Future<void> throwError(
  1. Object error,
  2. StackTrace stack, {
  3. BugType? bugType,
  4. BugSeverity? bugSeverity,
  5. Map<String, dynamic>? metaData,
})

Manually report an error to Atelerix

Use this to send custom errors or exceptions to your dashboard.

Parameters:

  • error - Error object or message
  • stack - Stack trace associated with the error
  • bugType - Optional bug classification
  • bugSeverity - Optional severity level
  • metaData - Optional additional context

Example:

try {
  await riskyOperation();
} catch (e, stack) {
  await Atelerix.throwError(
    e,
    stack,
    bugSeverity: BugSeverity.high,
    metaData: {
      'userId': '123',
      'action': 'payment',
      'amount': 100.0,
    },
  );
}

Implementation

static Future<void> throwError(
  Object error,
  StackTrace stack, {
  BugType? bugType,
  BugSeverity? bugSeverity,
  Map<String, dynamic>? metaData,
}) async {
  await ErrorsHandler().throwError(
    error,
    stack,
    bugType: bugType,
    bugSeverity: bugSeverity,
    metaData: metaData,
  );
}