Skip to content

Commit

Permalink
chore: 서버가 이상해도 클라이언트는 제대로 안내를 해주자.
Browse files Browse the repository at this point in the history
  • Loading branch information
potados99 committed Feb 27, 2022
1 parent d6a9ab2 commit e54eff1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/features/checkin/mixins/CheckInRequestMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ export default Vue.extend({
async tryCheckInAndGetError(ticket: string, gracefulInTime: boolean): Promise<HttpError | undefined> {
try {
const cafeteriaId = this.selectedCafeteria?.id;
assert(cafeteriaId);
assert(cafeteriaId, new HttpError('no_selected_cafeteria', '선택된 식당 정보가 없습니다!'));

await CheckInRepository.checkIn(ticket, cafeteriaId, gracefulInTime);

playSound('/sounds/success.mp3').then();

return undefined;
} catch (e) {
assert(e instanceof HttpError);

playSound('/sounds/fail.mp3').then();

return e;
return e instanceof HttpError
? e
: new HttpError(`fucked_up`, `죄송합니다. 정말 심각한 문제가 발생했습니다. 관리자에게 문의해주세요. ${e}`);
}
},

Expand Down

0 comments on commit e54eff1

Please sign in to comment.