Skip to content

Commit

Permalink
fix(app-service): fix bson serialize func log error;
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Nov 5, 2021
1 parent 8edecc8 commit 5f0fa95
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/app-service/src/api/function-log.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Author: Maslow<wangfugen@126.com>
* @Date: 2021-07-30 10:30:29
* @LastEditTime: 2021-11-05 12:06:42
* @LastEditTime: 2021-11-05 15:20:12
* @Description:
*/
import { ObjectId } from "bson"
Expand Down Expand Up @@ -32,6 +32,10 @@ export async function addFunctionLog(data: CloudFunctionLogStruct): Promise<any>
const db = DatabaseAgent.db

if (!data) return null
if (typeof data.error === 'object') {
data.error = data.error.toString() as any
}

const r = await db.collection(Constants.function_log_collection)
.insertOne({
...data,
Expand Down

0 comments on commit 5f0fa95

Please sign in to comment.