13 lines
323 B
TypeScript
13 lines
323 B
TypeScript
import { ErrorHandler } from "grammy";
|
|
import type { Context } from "#root/context.js";
|
|
import { getUpdateInfo } from "./logging.js";
|
|
|
|
export const errorHandler: ErrorHandler<Context> = (error) => {
|
|
const { ctx } = error;
|
|
|
|
ctx.logger.error({
|
|
err: error.error,
|
|
update: getUpdateInfo(ctx),
|
|
});
|
|
};
|