Skip to content

Commit e081b70

Browse files
ioedeveloperAniket-Engg
authored andcommitted
Catch errors for other compilation modes
1 parent d2c5812 commit e081b70

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

apps/remix-ide/src/app/tabs/compile-tab.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export default class CompileTab extends CompilerApiMixin(ViewPlugin) { // implem
120120

121121
compile(fileName) {
122122
if (!isNative(this.currentRequest.from)) this.call('notification', 'toast', compileToastMsg(this.currentRequest.from, fileName))
123-
super.compile(fileName)
123+
return super.compile(fileName)
124124
}
125125

126126
compileFile(event) {

libs/remix-ui/solidity-compiler/src/lib/api/compiler-api.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,9 @@ export const CompilerApiMixin = (Base) => class extends Base {
366366
if (this.currentFile && (this.currentFile.endsWith('.sol') || this.currentFile.endsWith('.yul'))) {
367367
if (await this.getAppParameter('hardhat-compilation')) this.compileTabLogic.runCompiler('hardhat')
368368
else if (await this.getAppParameter('truffle-compilation')) this.compileTabLogic.runCompiler('truffle')
369-
else this.compileTabLogic.runCompiler(undefined)
369+
else this.compileTabLogic.runCompiler(undefined).catch((error) => {
370+
this.call('notification', 'toast', error.message)
371+
})
370372
} else if (this.currentFile && this.currentFile.endsWith('.circom')) {
371373
await this.call('circuit-compiler', 'compile', this.currentFile)
372374
} else if (this.currentFile && this.currentFile.endsWith('.vy')) {

libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,9 @@ export const TabsUI = (props: TabsUIProps) => {
498498
if (tabsState.currentExt === 'vy') {
499499
await props.plugin.call(compilerName, 'vyperCompileCustomAction')
500500
} else {
501-
await props.plugin.call(compilerName, 'compile', path)
501+
await props.plugin.call(compilerName, 'compile', path).catch((error) => {
502+
props.plugin.call('notification', 'toast', error.message)
503+
})
502504
}
503505

504506
} catch (e) {

0 commit comments

Comments
 (0)