Skip to content

Commit 0fb9277

Browse files
committed
fix: improve error handling in Vision service and update Xray API services
1 parent 94a793c commit 0fb9277

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

libs/contract/constants/xray/stats.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const XRAY_DEFAULT_STATS_MODEL = {
2121

2222
export const XRAY_DEFAULT_API_MODEL = {
2323
api: {
24-
services: ['HandlerService', 'StatsService', 'LoggerService'],
24+
services: ['HandlerService', 'StatsService', 'RoutingService'],
2525
tag: 'api',
2626
},
2727
} as const;

src/modules/vision/vision.service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ export class VisionService {
2828
ip: ip,
2929
});
3030

31-
this.logger.log(res);
31+
if (!res.isOk) {
32+
throw new Error(res.message);
33+
}
3234

3335
return {
3436
isOk: true,
@@ -60,7 +62,9 @@ export class VisionService {
6062
ruleTag: ipHash,
6163
});
6264

63-
this.logger.log(res);
65+
if (!res.isOk) {
66+
throw new Error(res.message);
67+
}
6468

6569
return {
6670
isOk: true,

0 commit comments

Comments
 (0)