mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 17:03:49 +01:00
Better log
This commit is contained in:
parent
46db64a529
commit
7e7a9e692a
@ -55,7 +55,13 @@ export async function createNote(value: any, resolver?: Resolver, silent = false
|
||||
const object = await resolver.resolve(value) as any;
|
||||
|
||||
if (object == null || object.type !== 'Note') {
|
||||
logger.error(`invalid note: ${object}`);
|
||||
logger.error(`invalid note: ${value}`, {
|
||||
resolver: {
|
||||
history: resolver.getHistory()
|
||||
},
|
||||
value: value,
|
||||
object: object
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,10 @@ export default class Resolver {
|
||||
this.history = new Set();
|
||||
}
|
||||
|
||||
public getHistory(): string[] {
|
||||
return Array.from(this.history);
|
||||
}
|
||||
|
||||
public async resolveCollection(value: any) {
|
||||
const collection = typeof value === 'string'
|
||||
? await this.resolve(value)
|
||||
|
Loading…
Reference in New Issue
Block a user