From 51c908547778ceb8cd85bf4d0467919a4d39dff8 Mon Sep 17 00:00:00 2001 From: Junho Yeo Date: Tue, 25 Jul 2023 00:29:01 +0900 Subject: [PATCH] api: Fix verbose logs and `ThreadsAPIError` messages --- threads-api/src/threads-api.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/threads-api/src/threads-api.ts b/threads-api/src/threads-api.ts index 96c4690..bd09c9f 100644 --- a/threads-api/src/threads-api.ts +++ b/threads-api/src/threads-api.ts @@ -775,9 +775,9 @@ export class ThreadsAPI { } if (data?.status !== 'ok') { if (this.verbose) { - console.log('[USER FEED] Failed to fetch', data); + console.log('[USER PROFILE] Failed to fetch', data); } - throw new ThreadsAPIError('Failed to fetch user feed: ' + JSON.stringify(data), data); + throw new ThreadsAPIError('Failed to fetch user profile: ' + JSON.stringify(data), data); } return data; }; @@ -818,9 +818,9 @@ export class ThreadsAPI { } if (data?.status !== 'ok') { if (this.verbose) { - console.log('[USER FEED] Failed to fetch', data); + console.log('[USER THREADS] Failed to fetch', data); } - throw new ThreadsAPIError('Failed to fetch user feed: ' + JSON.stringify(data), data); + throw new ThreadsAPIError('Failed to fetch user threads: ' + JSON.stringify(data), data); } return data; }; @@ -902,9 +902,9 @@ export class ThreadsAPI { } if (data?.status !== 'ok') { if (this.verbose) { - console.log('[USER FEED] Failed to fetch', data); + console.log('[USER REPLIES] Failed to fetch', data); } - throw new ThreadsAPIError('Failed to fetch user feed: ' + JSON.stringify(data), data); + throw new ThreadsAPIError('Failed to fetch user replies: ' + JSON.stringify(data), data); } return data; }; @@ -968,9 +968,9 @@ export class ThreadsAPI { } if (data?.status !== 'ok') { if (this.verbose) { - console.log('[USER FOLLOWING] Failed to fetch', data); + console.log('[USER FOLLOWINGS] Failed to fetch', data); } - throw new ThreadsAPIError('Failed to fetch user following: ' + JSON.stringify(data), data); + throw new ThreadsAPIError('Failed to fetch user followings: ' + JSON.stringify(data), data); } return data; }; @@ -1366,9 +1366,9 @@ export class ThreadsAPI { } if (data?.status !== 'ok') { if (this.verbose) { - console.log('[NOTIFICATIONS] Failed to fetch', data); + console.log('[USER SEARCH] Failed to fetch', data); } - throw new ThreadsAPIError('Failed to fetch notifications: ' + JSON.stringify(data), data); + throw new ThreadsAPIError('Failed to fetch user search results: ' + JSON.stringify(data), data); } return data; };