mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Merge branch 'main' of github.com:stackframe-projects/stack
This commit is contained in:
commit
cff003722f
@ -30,10 +30,8 @@ export function throwStackErr(message: string, extraData?: any): never {
|
||||
const errorSinks = new Set<(location: string, error: unknown) => void>();
|
||||
export function registerErrorSink(sink: (location: string, error: unknown) => void): void {
|
||||
if (errorSinks.has(sink)) {
|
||||
console.log("Error sink already registered", sink);
|
||||
return;
|
||||
}
|
||||
console.log("Registering error sink", sink);
|
||||
errorSinks.add(sink);
|
||||
}
|
||||
registerErrorSink((location, ...args) => console.error(`Error in ${location}:`, ...args));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user