Errors now show app frames highlighted with relative paths and library frames collapsed, both in ANSI on the console and as a styled HTML page in the browser. Process-level uncaughtException/unhandledRejection handlers also use the formatter. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
32 lines
616 B
TypeScript
32 lines
616 B
TypeScript
import{cli}from'./diachron/cli'
|
|
import { formatError } from './diachron/errors';
|
|
|
|
process.on('uncaughtException', (err) => {
|
|
console.error(formatError(err));
|
|
process.exit(1);
|
|
});
|
|
|
|
process.on('unhandledRejection', (reason) => {
|
|
console.error(formatError(reason));
|
|
});
|
|
|
|
import { core } from "./diachron/core";
|
|
|
|
import { routes } from "./routes";
|
|
import {makeApp}from'./diachron/app'
|
|
|
|
|
|
const app = makeApp({routes});
|
|
|
|
|
|
core.logging.log({ source: "logging", text: ["1"] });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.listen(cli.listen.port, cli.listen.host, () => {
|
|
console.log(`Listening on ${cli.listen.host}:${cli.listen.port}`);
|
|
});
|