ceylon/ceylon-compiler — Issue #405: Better error message for invalid SHA1 signatures
Author: FroMage
Created: 2012-02-27 10:11:00+00:00
State: open
Labels: FEATURE, high priority, modularity

If the output module's SHA1 is invalid, the compiler crashes:

```
An exception has occurred in the compiler (ceylonc 0.1 'Newton').
java.lang.IllegalArgumentException: Invalid SHA1 for artifact: default-unversioned
at com.redhat.ceylon.cmr.impl.AbstractNodeRepository.getLeafNode(AbstractNodeRepository.java:175)
at com.redhat.ceylon.cmr.impl.SimpleRepository.getArtifact(SimpleRepository.java:51)
at com.redhat.ceylon.compiler.java.loader.CeylonEnter.addModuleToClassPath(CeylonEnter.java:221)
at com.redhat.ceylon.compiler.java.tools.LanguageCompiler.loadModuleFromSource(LanguageCompiler.java:322)
at com.redhat.ceylon.compiler.java.tools.LanguageCompiler.loadCompiledModules(LanguageCompiler.java:274)
at com.redhat.ceylon.compiler.java.tools.LanguageCompiler.parseFiles(LanguageCompiler.java:261)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:805)
at com.redhat.ceylon.compiler.java.launcher.Main.compile(Main.java:457)
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:132)
```

We need to make the CMR throw a typed exception, and catch it to give a more helpful message.