Skip to content

Commit 2f33645

Browse files
committed
fix(logging): correct logging for capture type
1 parent eefeff4 commit 2f33645

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function useFlytrapFunction<
6767
* Flytrap API.
6868
*/
6969
saveErrorForFunction(opts.id, error)
70-
70+
log.info('capture', `Captured error in async function with ID "${opts.id}".`, { error })
7171
const { error: saveError } = await tryCatch(
7272
getFlytrapStorage().saveCapture(_executingFunctions, _functionCalls, error as Error)
7373
)
@@ -130,7 +130,7 @@ export function useFlytrapFunction<
130130
* Flytrap API.
131131
*/
132132
saveErrorForFunction(opts.id, error)
133-
133+
log.info('capture', `Captured error in function with ID "${opts.id}".`, { error })
134134
const { error: saveError } = tryCatchSync(() =>
135135
getFlytrapStorage().saveCapture(_executingFunctions, _functionCalls, error as Error)
136136
)
@@ -228,7 +228,7 @@ export function useFlytrapCall<T>(fnOrNamespace: T, opts: FlytrapCallOptions): a
228228
* Flytrap API.
229229
*/
230230
saveErrorForFunctionCall(opts.id, error as Error)
231-
231+
log.info('capture', `Captured error in function call with ID "${opts.id}".`, { error })
232232
throw error
233233
}
234234
}
@@ -272,7 +272,7 @@ export async function useFlytrapCallAsync<T extends (...args: any[]) => Promise<
272272
* Flytrap API.
273273
*/
274274
saveErrorForFunctionCall(opts.id, error)
275-
275+
log.info('capture', `Captured error in async function call with ID "${opts.id}".`, { error })
276276
throw error
277277
}
278278
}

src/transform/artifacts/cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const _populateCache = async (projectId: string, secretApiKey: string): Promise<
5858
}
5959

6060
function _removeDatabaseKeys(artifact: DatabaseArtifact): Artifact {
61-
const { id, createdAt, projectId, ...rest } = artifact
61+
const { id: _id, createdAt: _createdAt, projectId: _projectId, ...rest } = artifact
6262
if (rest.functionId === null) delete rest.functionId
6363
return rest
6464
}

0 commit comments

Comments
 (0)