diff --git a/package.json b/package.json index 6b81aad..6f72783 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chanterelle", - "version": "5.0.1", + "version": "5.1.0", "description": "A more functional truffle", "license": "ISC", "scripts": { diff --git a/src/Chanterelle/Internal/Compile.purs b/src/Chanterelle/Internal/Compile.purs index 8e701d7..e34dbba 100644 --- a/src/Chanterelle/Internal/Compile.purs +++ b/src/Chanterelle/Internal/Compile.purs @@ -192,7 +192,13 @@ decodeModuleOutput moduleName (ST.CompilerOutput output) = do isSolcWarning (ST.FullCompilationError se) = se.severity == ST.SeverityWarning isSolcWarning _ = false ({ yes: warnings, no: errors }) = partition isSolcWarning output.errors - for_ warnings (logSolcError moduleName) + isModuleError (ST.FullCompilationError se) = fromMaybe false ado + ST.SourceLocation fesl <- se.sourceLocation + in fesl.file == moduleFilename + isModuleError _ = false + ({ yes: moduleErrors, no: otherErrors }) = partition isModuleError errors + for_ (warnings <> otherErrors) (logSolcError moduleName) + unless (moduleErrors == mempty) $ throwError $ CompilationError { moduleName, errors: moduleErrors } case M.lookup moduleFilename output.contracts of Nothing -> throwError $ CompilationError { moduleName, errors } Just contractMap' -> pure contractMap'