Skip to content

Commit

Permalink
Remove logging of RPC errors (#2410)
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot authored Aug 7, 2023
1 parent ed65c55 commit 456f306
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions packages/toolpad-app/src/server/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import * as z from 'zod';
import { fromZodError } from 'zod-validation-error';
import { hasOwnProperty } from '@mui/toolpad-utils/collections';
import { errorFrom, serializeError } from '@mui/toolpad-utils/errors';
import { indent } from '@mui/toolpad-utils/strings';
import chalk from 'chalk';
import { asyncHandler } from '../utils/express';
import type { ToolpadProject } from './localMode';

Expand Down Expand Up @@ -86,18 +84,6 @@ export function createRpcHandler(definition: Definition): express.RequestHandler
: { result: superjson.stringify(rawResult) };

res.json(responseData);

if (error) {
// eslint-disable-next-line no-console
console.log(`${chalk.red('error')} - RPC error`);
if (error.stack) {
// eslint-disable-next-line no-console
console.log(indent(error.stack, 2));
} else {
// eslint-disable-next-line no-console
console.log(indent(`${error.name}: ${error.message}`, 2));
}
}
}),
);
return router;
Expand Down

0 comments on commit 456f306

Please sign in to comment.