Skip to content

Commit ce5f4c4

Browse files
committed
merge main
2 parents 1ee01fc + bb909b9 commit ce5f4c4

File tree

7 files changed

+35
-39
lines changed

7 files changed

+35
-39
lines changed

packages/commandkit/src/analytics/analytics-engine.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { CommandKit } from '../commandkit';
22
import { Logger } from '../logger/Logger';
3-
import { warnUnstable } from '../utils/warn-unstable';
43
import {
54
AnalyticsEvent,
65
AnalyticsProvider,
@@ -83,7 +82,7 @@ export class AnalyticsEngine {
8382
try {
8483
await this.#provider!.identify?.(this, event);
8584
} catch (error) {
86-
Logger.error`Error identifying with provider ${this.#provider!.name} ${error}`;
85+
Logger.error`Error identifying with provider ${this.#provider!.name}: ${error}`;
8786
}
8887
}
8988

@@ -99,7 +98,7 @@ export class AnalyticsEngine {
9998
if (await this.#doNotTrack(event)) return;
10099
await this.#provider!.track(this, event);
101100
} catch (error) {
102-
Logger.error`Error tracking ${event.name} event with provider ${this.#provider!.name} ${error}`;
101+
Logger.error`Error tracking ${event.name} event with provider ${this.#provider!.name}: ${error}`;
103102
}
104103
}
105104

packages/commandkit/src/app/handlers/AppCommandHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ export class AppCommandHandler {
727727

728728
this.loadedMiddlewares.set(id, { middleware, data });
729729
} catch (error) {
730-
Logger.error`Failed to load middleware ${id}\n${error}`;
730+
Logger.error`Failed to load middleware ${id}: ${error}`;
731731
}
732732
}
733733

@@ -863,7 +863,7 @@ export class AppCommandHandler {
863863
},
864864
});
865865
} catch (error) {
866-
Logger.error`Failed to load command ${command.name} (${id})\n${error}`;
866+
Logger.error`Failed to load command ${command.name} (${id}): ${error}`;
867867
}
868868
}
869869

packages/commandkit/src/app/handlers/AppEventsHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export class AppEventsHandler {
217217
// Otherwise log the error as usual
218218
Logger.error`Error handling event ${name}${
219219
namespace ? ` of namespace ${namespace}` : ''
220-
} ${e}`;
220+
}: ${e}`;
221221
}
222222
}
223223
},
@@ -281,7 +281,7 @@ export class AppEventsHandler {
281281
// Otherwise log the error as usual
282282
Logger.error`Error handling event ${name}${
283283
namespace ? ` of namespace ${namespace}` : ''
284-
} ${e}`;
284+
}: ${e}`;
285285
}
286286
},
287287
);

packages/commandkit/src/app/middlewares/permissions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export async function beforeExecute(ctx: MiddlewareContext) {
4444
}
4545
}
4646
} catch (error) {
47-
Logger.error`Could not send 'Server-only command' DM to user ${interaction?.user.id ?? message?.author.id} for command ${command.command.name}. ${error}`;
47+
Logger.error`Could not send 'Server-only command' DM to user ${interaction?.user.id ?? message?.author.id} for command ${command.command.name}: ${error}`;
4848
}
4949

5050
stopMiddlewares(); // Stop the command from executing
@@ -151,7 +151,7 @@ export async function beforeExecute(ctx: MiddlewareContext) {
151151
});
152152
}
153153
} catch (error) {
154-
Logger.error`Could not send 'Not enough permissions' reply to user ${interaction?.user.id ?? message?.author.id} for command ${command.command.name}. ${error}`;
154+
Logger.error`Could not send 'Not enough permissions' reply to user ${interaction?.user.id ?? message?.author.id} for command ${command.command.name}: ${error}`;
155155
}
156156

157157
stopMiddlewares(); // Stop the command from executing

packages/commandkit/src/app/register/CommandRegistrar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export class CommandRegistrar {
172172
`✨ Refreshed ${data.length} global application (/) commands`,
173173
);
174174
} catch (e) {
175-
Logger.error`Failed to update global application (/) commands ${e}`;
175+
Logger.error`Failed to update global application (/) commands: ${e}`;
176176
}
177177
}
178178

@@ -253,7 +253,7 @@ export class CommandRegistrar {
253253

254254
Logger.info(`✨ Refreshed ${count} guild application (/) commands`);
255255
} catch (e) {
256-
Logger.error`Failed to update guild application (/) commands ${e}`;
256+
Logger.error`Failed to update guild application (/) commands: ${e}`;
257257
}
258258
}
259259
}

packages/commandkit/src/plugins/plugin-runtime/CommandKitPluginRuntime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export class CommandKitPluginRuntime {
144144
return true;
145145
}
146146

147-
Logger.error`Plugin "${plugin.name}" failed ${e}`;
147+
Logger.error`Plugin "${plugin.name}" failed: ${e?.stack || e}`;
148148
}
149149
}
150150

pnpm-lock.yaml

Lines changed: 24 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)