Skip to content

Commit

Permalink
Change compile error printing/throwing logic (#127)
Browse files Browse the repository at this point in the history
* Change compile error printing/throwing logic

* Bump to version 5.1.0
  • Loading branch information
iostat committed Oct 20, 2020
1 parent 04f10b9 commit a918c3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "chanterelle",
"version": "5.0.1",
"version": "5.1.0",
"description": "A more functional truffle",
"license": "ISC",
"scripts": {
Expand Down
8 changes: 7 additions & 1 deletion src/Chanterelle/Internal/Compile.purs
Expand Up @@ -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'
Expand Down

0 comments on commit a918c3e

Please sign in to comment.