Ignore parsing errors on non *.class files which can be add through build systems. #41

This commit is contained in:
Volker Berlin 2022-05-28 16:36:37 +02:00
parent ad93c2c10b
commit 97f9fb39a7
No known key found for this signature in database
GPG Key ID: 988423EF815BE4CB

View File

@ -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.
@ -362,7 +362,11 @@ public class JWebAssembly {
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();