Skip to content

Commit

Permalink
Ignore parsing errors on non *.class files which can be add through b…
Browse files Browse the repository at this point in the history
…uild systems. #41
  • Loading branch information
Horcrux7 committed May 28, 2022
1 parent ad93c2c commit 97f9fb3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/de/inetsoftware/jwebassembly/JWebAssembly.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 - 2020 Volker Berlin (i-net software)
* Copyright 2017 - 2022 Volker Berlin (i-net software)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -362,7 +362,11 @@ private void compile( ModuleWriter writer, WasmTarget target ) throws IOExceptio
ClassFile classFile = new ClassFile( new BufferedInputStream( url.openStream() ) );
generator.prepare( classFile );
} catch( IOException ex ) {
throw WasmException.create( "Parsing of file " + url + " failed.", ex );
LOGGER.fine( url + " " + ex );
if( url.getFile().endsWith( ".class" ) ) {
throw WasmException.create( "Parsing of file " + url + " failed.", ex );
}
// does not throw an exception on non *.class files like resource files or *.kotlin_module
}
}
generator.prepareFinish();
Expand Down

0 comments on commit 97f9fb3

Please sign in to comment.