Commit e08af193 authored by nanahira's avatar nanahira

better return

parent 980c4376
Pipeline #17685 passed with stages
in 6 minutes and 15 seconds
......@@ -1796,13 +1796,19 @@ export class AppService {
this.log.log(
`${user.username} has no duel records, cannot use ${dto.getName()}.`,
);
throw new HttpException(new CodeResponseDto(402), 402);
throw new HttpException(
new CodeResponseDto(402, 'No duel records.'),
402,
);
}
if (userInfo.exp < dto.cost) {
this.log.log(
`${user.username} has no enough exp to use novelai: ${userInfo.exp}`,
);
throw new HttpException(new CodeResponseDto(402), 402);
throw new HttpException(
new CodeResponseDto(402, 'Not enough exp.'),
402,
);
}
this.log.log(
`${user.username} paid ${dto.cost} exp to use ${dto.getName()}.`,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment