|
1 | 1 | import { Event, Exception, ExtendedError, StackFrame } from '@sentry/types'; |
2 | | -import { addContextToFrame, basename, dirname, SyncPromise } from '@sentry/utils'; |
| 2 | +import { addContextToFrame, basename, dirname, SyncPromise, syncPromiseResolve } from '@sentry/utils'; |
3 | 3 | import { readFile } from 'fs'; |
4 | 4 | import { LRUMap } from 'lru_map'; |
5 | 5 |
|
@@ -71,7 +71,7 @@ function getModule(filename: string, base?: string): string { |
71 | 71 | function readSourceFiles(filenames: string[]): PromiseLike<{ [key: string]: string | null }> { |
72 | 72 | // we're relying on filenames being de-duped already |
73 | 73 | if (filenames.length === 0) { |
74 | | - return SyncPromise.resolve({}); |
| 74 | + return syncPromiseResolve({}); |
75 | 75 | } |
76 | 76 |
|
77 | 77 | return new SyncPromise<{ |
@@ -176,15 +176,15 @@ export function parseStack(stack: stacktrace.StackFrame[], options?: NodeOptions |
176 | 176 |
|
177 | 177 | // We do an early return if we do not want to fetch context liens |
178 | 178 | if (linesOfContext <= 0) { |
179 | | - return SyncPromise.resolve(frames); |
| 179 | + return syncPromiseResolve(frames); |
180 | 180 | } |
181 | 181 |
|
182 | 182 | try { |
183 | 183 | return addPrePostContext(filesToRead, frames, linesOfContext); |
184 | 184 | } catch (_) { |
185 | 185 | // This happens in electron for example where we are not able to read files from asar. |
186 | 186 | // So it's fine, we recover be just returning all frames without pre/post context. |
187 | | - return SyncPromise.resolve(frames); |
| 187 | + return syncPromiseResolve(frames); |
188 | 188 | } |
189 | 189 | } |
190 | 190 |
|
|
0 commit comments