Skip to content

Commit 039679c

Browse files
committed
πŸ› fix: μΈμ¦μ„œ 였λ₯˜ μ•ˆλ‚΄ λ©”μ‹œμ§€ μΆ”κ°€
1 parent 422a5b1 commit 039679c

File tree

1 file changed

+33
-7
lines changed

1 file changed

+33
-7
lines changed

β€Žsrc/main/index.tsβ€Ž

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import 'reflect-metadata'
22

3+
import { app, dialog } from 'electron'
4+
import log from 'electron-log'
5+
36
import { NestFactory } from '@nestjs/core'
47
import * as Sentry from '@sentry/electron/main'
58

@@ -15,15 +18,38 @@ if (process.env.NODE_ENV !== 'development') {
1518
}
1619

1720
const bootstrap = async () => {
18-
const app = await NestFactory.createApplicationContext(AppModule)
21+
try {
22+
const app = await NestFactory.createApplicationContext(AppModule)
23+
24+
const leagueService = app.get(LeagueService)
25+
const updateService = app.get(UpdateService)
26+
const electronService = app.get(ElectronService)
27+
28+
await leagueService.clientInitialize()
29+
await updateService.autoUpdate()
30+
await electronService.start()
31+
} catch (error: any) {
32+
log.error('Failed to bootstrap application')
33+
log.error(error?.message, error)
34+
35+
await app.whenReady()
1936

20-
const leagueService = app.get(LeagueService)
21-
const updateService = app.get(UpdateService)
22-
const electronService = app.get(ElectronService)
37+
if (error?.message === 'unable to verify the first certificate') {
38+
dialog.showErrorBox(
39+
'μ•± μ‹€ν–‰ 였λ₯˜',
40+
`μΈμ¦μ„œ 였λ₯˜λ‘œ 인해 앱을 μ‹€ν–‰ν•  수 μ—†μŠ΅λ‹ˆλ‹€.\nλ„€νŠΈμ›Œν¬λ₯Ό λ³€κ²½ν•˜λŠ” 앱이 μ‹€ν–‰ 쀑이라면 이 앱은 μ œμ™Έν•΄μ£Όμ„Έμš”. (μ˜ˆμ‹œ: μœ λ‹ˆμ½˜ Pro)\nμžμ„Έν•œ λ‘œκ·ΈλŠ” ${
41+
log.transports.file.getFile().path
42+
}`,
43+
)
44+
} else {
45+
dialog.showErrorBox(
46+
'μ•± μ‹€ν–‰ 였λ₯˜',
47+
`${error?.message}\nμžμ„Έν•œ λ‘œκ·ΈλŠ” ${log.transports.file.getFile().path}`,
48+
)
49+
}
2350

24-
await leagueService.clientInitialize()
25-
await updateService.autoUpdate()
26-
await electronService.start()
51+
process.exit(1)
52+
}
2753
}
2854

2955
bootstrap()

0 commit comments

Comments
Β (0)