mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-23 04:34:15 -04:00
13 lines
367 B
TypeScript
13 lines
367 B
TypeScript
import type { IncomingMessage } from 'connect';
|
|
import type { Request } from 'express';
|
|
|
|
import { newDate } from './helpers.ts';
|
|
|
|
export default (err: Error, req: Request | IncomingMessage | undefined): string => {
|
|
return `[${
|
|
newDate().toISOString()
|
|
}] [${
|
|
req ? `${req.method} ${req.url}` : ''
|
|
}] ${err.message || err} ${err.stack}`;
|
|
};
|