File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1+ import { routes } from './routes' ;
12import { TypeSystem } from '../../json-type' ;
23import { TypeRouter } from '../../json-type/system/TypeRouter' ;
34import { TypeRouterCaller } from '../../reactive-rpc/common/rpc/caller/TypeRouterCaller' ;
4- import { routes } from './routes ' ;
5+ import { RpcError } from '../../reactive-rpc/common/rpc/caller ' ;
56import type { Services } from '../services/Services' ;
67import type { RouteDeps } from './types' ;
78
@@ -14,6 +15,13 @@ export const createRouter = (services: Services) => {
1415
1516export const createCaller = ( services : Services ) => {
1617 const router = createRouter ( services ) ;
17- const caller = new TypeRouterCaller < typeof router > ( { router} ) ;
18+ const caller = new TypeRouterCaller < typeof router > ( {
19+ router,
20+ wrapInternalError : ( error : unknown ) => {
21+ if ( error instanceof RpcError ) console . error ( error . toJson ( ) ) ;
22+ else console . error ( error ) ;
23+ return RpcError . valueFrom ( error ) ;
24+ } ,
25+ } ) ;
1826 return caller ;
1927} ;
You can’t perform that action at this time.
0 commit comments