Skip to main content

Error Tracking

Catch and diagnose errors before your users report them.

What Gets Tracked

SkySignal automatically captures:

FieldDescription
messageError message
stackFull stack trace
typeError type (method, subscription, server)
methodNameMethod that threw (if applicable)
userIdUser who encountered the error
timestampWhen the error occurred
contextAdditional context data
hostServer that threw the error

Error Sources

Method Errors

Errors thrown in Meteor Methods are automatically captured:

Meteor.methods({
'orders.create': function(data) {
if (!this.userId) {
// This error is automatically tracked
throw new Meteor.Error('not-authorized', 'You must be logged in');
}
// ...
}
});

Subscription Errors

Errors in publications:

Meteor.publish('privateData', function() {
if (!this.userId) {
// Automatically tracked
throw new Meteor.Error('not-authorized');
}
return PrivateData.find({ userId: this.userId });
});

Unhandled Exceptions

Server-side unhandled exceptions:

// Uncaught errors are automatically captured
process.on('uncaughtException', (err) => {
// SkySignal captures this
});

Viewing Error Data

Errors Dashboard

Navigate to your site's Errors tab to see:

  • Error Timeline - Errors over time
  • Error Groups - Errors grouped by message/type
  • Error Rate - Percentage of requests that error
  • Recent Errors - Latest error occurrences

Error Details

Click on any error group to see:

  • Full stack trace
  • Error context and metadata
  • Affected users
  • Historical frequency
  • Related method/subscription

Configuration

Enable/Disable Error Tracking

SkySignal.init({
apiKey: '...',
trackErrors: true, // Enable (default)
});

Capture Error Context

Include additional context with errors:

SkySignal.init({
apiKey: '...',
captureErrorContext: true, // Enable (default)
});

Ignore Specific Errors

Exclude certain errors from tracking:

SkySignal.init({
apiKey: '...',
ignoreErrors: [
'not-authorized', // Ignore by error code
/network timeout/i, // Ignore by message pattern
(error) => error.expected, // Custom filter function
],
});

Source Maps

Enable source map support for readable stack traces:

Upload Source Maps

After building your app, upload source maps:

# Using the SkySignal CLI
skysignal sourcemaps upload \
--api-key $SKYSIGNAL_API_KEY \
--version 1.0.0 \
./bundle/programs/server/*.js.map

Configure in Dashboard

  1. Go to Site Settings > Source Maps
  2. Enable "Source Map Support"
  3. Upload maps for each release

Adding Context

Automatic Context

SkySignal automatically captures:

  • User ID and session info
  • Request/method details
  • Server hostname
  • Timestamp

Custom Context

Add custom context to errors:

// Add context globally
SkySignal.setContext({
environment: 'production',
region: 'us-east-1',
});

// Add context to specific error
try {
processOrder(orderId);
} catch (error) {
SkySignal.captureError(error, {
orderId,
step: 'payment-processing',
});
throw error;
}

Manual Error Capture

Capture errors that you handle gracefully:

try {
await riskyOperation();
} catch (error) {
// Log to SkySignal without re-throwing
SkySignal.captureError(error, {
severity: 'warning',
handled: true,
});

// Handle gracefully
return fallbackValue;
}

Error Grouping

SkySignal groups errors by:

  1. Error message (with variable parts normalized)
  2. Stack trace fingerprint
  3. Error type/code

This prevents duplicate errors from flooding your dashboard.

Best Practices

1. Use Meteor.Error for Expected Errors

// Good: Provides error code for grouping
throw new Meteor.Error('validation-failed', 'Email is invalid');

// Less ideal: Generic error
throw new Error('Email is invalid');

2. Add Meaningful Context

SkySignal.captureError(error, {
userId: Meteor.userId(),
action: 'checkout',
cartItems: cart.items.length,
});

3. Don't Ignore All Errors

Be selective about what you ignore:

// Bad: Ignoring too much
ignoreErrors: [/.*/]

// Good: Specific patterns
ignoreErrors: [
'not-authorized', // Expected for logged-out users
/timeout/i, // Network issues
]

4. Set Up Alerts

Configure alerts for:

  • New error types
  • Error rate spikes
  • Critical error patterns

See Alerting Guide for setup instructions.

Troubleshooting

Errors Not Appearing

  1. Verify trackErrors: true
  2. Check if error matches ignoreErrors
  3. Ensure error is actually thrown (not just logged)
  4. Check network connectivity to SkySignal

Stack Traces Unreadable

  1. Upload source maps for your version
  2. Verify source map file names match
  3. Check source map upload succeeded

Next Steps