Skip to content

Commit

Permalink
chore: 로깅 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoto-Cocoa committed Jul 10, 2023
1 parent 98fd7d4 commit 72876bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export async function handler(event: APIGatewayProxyEventV2WithRequestContext<AP
const targetNote = note.renote ?? note;
const chunks = [ note.renote?.text ?? note.text ?? '' ];

console.log(`Request from ${note.user.username}@${host}`)

if (!isValidRequest(note)) {
return buildResponse({
statusCode: 200,
Expand Down Expand Up @@ -329,7 +331,7 @@ async function getUser(userId: string): Promise<User | null> {
const user = JSON.parse(await Body.transformToString()) as User;

if (user.misskeyId !== userId) {
throw new Error('User file is invalid');
throw new Error(`User file is invalid; Expected ${userId}, got ${user.misskeyId}`);
}

return Object.assign({}, await getBaseProfile(user.baseProfile), user);
Expand Down

0 comments on commit 72876bc

Please sign in to comment.