Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions packages/minimal/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@ function callOnHub<T>(method: string, ...args: any[]): T {
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
export function captureException(exception: any, captureContext?: CaptureContext): string {
let syntheticException: Error;
try {
throw new Error('Sentry syntheticException');
} catch (exception) {
syntheticException = exception as Error;
}
const syntheticException = new Error('Sentry syntheticException');

return callOnHub('captureException', exception, {
captureContext,
originalException: exception,
Expand All @@ -57,12 +53,7 @@ export function captureException(exception: any, captureContext?: CaptureContext
* @returns The generated eventId.
*/
export function captureMessage(message: string, captureContext?: CaptureContext | Severity): string {
let syntheticException: Error;
try {
throw new Error(message);
} catch (exception) {
syntheticException = exception as Error;
}
const syntheticException = new Error(message);

// This is necessary to provide explicit scopes upgrade, without changing the original
// arity of the `captureMessage(message, level)` method.
Expand Down