From 82e5f367b8c5a7fb4bc1000ab771ac1dad2e5248 Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Sun, 23 Feb 2020 20:17:37 +0100 Subject: [PATCH] fix debug message on error --- .../inetsoftware/jwebassembly/module/ModuleGenerator.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/de/inetsoftware/jwebassembly/module/ModuleGenerator.java b/src/de/inetsoftware/jwebassembly/module/ModuleGenerator.java index c464b59..6f8044c 100644 --- a/src/de/inetsoftware/jwebassembly/module/ModuleGenerator.java +++ b/src/de/inetsoftware/jwebassembly/module/ModuleGenerator.java @@ -335,9 +335,9 @@ public class ModuleGenerator { */ public void finish() throws IOException { for( Iterator it = functions.getWriteLater(); it.hasNext(); ) { - sourceFile = null; // clear previous value for the case an IO exception occur - className = null; FunctionName next = it.next(); + sourceFile = null; // clear previous value for the case an IO exception occur + className = next.className; if( next instanceof SyntheticFunctionName ) { writeMethodImpl( next, ((SyntheticFunctionName)next).getCodeBuilder( watParser ) ); } else { @@ -363,8 +363,8 @@ public class ModuleGenerator { if( functions.needToWrite( next ) ) { writeMethod( next, method ); } - } catch (IOException ioex){ - throw WasmException.create( ioex, sourceFile, className, -1 ); + } catch (Throwable ex){ + throw WasmException.create( ex, sourceFile, className, -1 ); } } else { if( functions.needToWrite( next ) ) {