зеркало из https://github.com/electron/electron.git
Merge pull request #9991 from electron/surface-runas-require-errors
Surface require errors via answer IPC message
This commit is contained in:
Коммит
1d32f300f3
|
@ -2,8 +2,21 @@
|
|||
<body>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
const {ipcRenderer} = require('electron')
|
||||
const runas = require('runas')
|
||||
ipcRenderer.send('answer', typeof runas)
|
||||
|
||||
let runas
|
||||
let requireError
|
||||
|
||||
try {
|
||||
runas = require('runas')
|
||||
} catch (error) {
|
||||
requireError = error
|
||||
}
|
||||
|
||||
if (requireError != null) {
|
||||
ipcRenderer.send('answer', `Require runas failed: ${requireError.message}`)
|
||||
} else {
|
||||
ipcRenderer.send('answer', typeof runas)
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Загрузка…
Ссылка в новой задаче