diff --git a/src/de/inetsoftware/jwebassembly/module/JavaMethodWasmCodeBuilder.java b/src/de/inetsoftware/jwebassembly/module/JavaMethodWasmCodeBuilder.java index cae9df4..8fb6313 100644 --- a/src/de/inetsoftware/jwebassembly/module/JavaMethodWasmCodeBuilder.java +++ b/src/de/inetsoftware/jwebassembly/module/JavaMethodWasmCodeBuilder.java @@ -98,7 +98,7 @@ class JavaMethodWasmCodeBuilder extends WasmCodeBuilder { AnyType returnType = new ValueTypeParser( method.getType().substring( method.getType().lastIndexOf( ')' ) + 1), getTypeManager() ).next(); writeCode( byteCode, code.getConstantPool(), method.getDeclaringClassFile(), returnType ); calculateVariables(); - } catch( Exception ioex ) { + } catch( Throwable ioex ) { int lineNumber = byteCode == null ? -1 : byteCode.getLineNumber(); throw WasmException.create( ioex, lineNumber ); } @@ -763,7 +763,7 @@ class JavaMethodWasmCodeBuilder extends WasmCodeBuilder { patchTypeOfNullConst(); } - } catch( Exception ex ) { + } catch( Throwable ex ) { throw WasmException.create( ex, lineNumber ); } } @@ -988,7 +988,7 @@ class JavaMethodWasmCodeBuilder extends WasmCodeBuilder { } } } - } catch( Exception ex ) { + } catch( Throwable ex ) { throw WasmException.create( ex, instr.getLineNumber() ); } } diff --git a/src/de/inetsoftware/jwebassembly/module/ModuleGenerator.java b/src/de/inetsoftware/jwebassembly/module/ModuleGenerator.java index f3051df..53bdcc8 100644 --- a/src/de/inetsoftware/jwebassembly/module/ModuleGenerator.java +++ b/src/de/inetsoftware/jwebassembly/module/ModuleGenerator.java @@ -485,7 +485,7 @@ public class ModuleGenerator { for( MethodInfo method : methods ) { handler.accept( method ); } - } catch( IOException ioex ) { + } catch( Throwable ioex ) { throw WasmException.create( ioex, sourceFile, className, methodName, -1 ); } } @@ -526,7 +526,7 @@ public class ModuleGenerator { functions.markAsExport( name, annotationValues ); return; } - } catch( Exception ioex ) { + } catch( Throwable ioex ) { throw WasmException.create( ioex, sourceFile, className, methodName, -1 ); } } @@ -604,7 +604,7 @@ public class ModuleGenerator { } throw new WasmException( "Abstract or native method can not be used: " + name.signatureName +"\nIf you want to use classes with native code, you must use a library that implements these native methods, such as 'de.inetsoftware:jwebassembly-api:+'.", -1 ); } - } catch( Exception ioex ) { + } catch( Throwable ioex ) { int lineNumber = code == null ? -1 : code.getFirstLineNr(); throw WasmException.create( ioex, sourceFile, className, methodName, lineNumber ); } diff --git a/src/de/inetsoftware/jwebassembly/module/StaticCodeBuilder.java b/src/de/inetsoftware/jwebassembly/module/StaticCodeBuilder.java index eb55ea4..2b9b571 100644 --- a/src/de/inetsoftware/jwebassembly/module/StaticCodeBuilder.java +++ b/src/de/inetsoftware/jwebassembly/module/StaticCodeBuilder.java @@ -197,7 +197,7 @@ class StaticCodeBuilder { state.dependenciesClasses.add( otherClassName ); } } - } catch( IOException ex ) { + } catch( Throwable ex ) { throw WasmException.create( ex, sourceFile, className, name.methodName, instr == null ? -1 : instr.getLineNumber() ); } return state; diff --git a/src/de/inetsoftware/jwebassembly/module/WasmCodeBuilder.java b/src/de/inetsoftware/jwebassembly/module/WasmCodeBuilder.java index 427fc70..888c87e 100644 --- a/src/de/inetsoftware/jwebassembly/module/WasmCodeBuilder.java +++ b/src/de/inetsoftware/jwebassembly/module/WasmCodeBuilder.java @@ -553,7 +553,7 @@ public abstract class WasmCodeBuilder { FieldInfo field = classFile.getField( name.methodName ); AnyType type = new ValueTypeParser( field.getType(), types ).next(); addGlobalInstruction( load, name, type, null, javaCodePos, lineNumber ); - } catch( Exception ex ) { + } catch( Throwable ex ) { throw WasmException.create( ex, lineNumber ); } } @@ -865,7 +865,7 @@ public abstract class WasmCodeBuilder { return new FunctionName( method ); } } - } catch( IOException ex ) { + } catch( Throwable ex ) { throw WasmException.create( ex, lineNumber ); } throw new WasmException( "Not implemented NonGC polyfill function: " + name, lineNumber ); diff --git a/src/de/inetsoftware/jwebassembly/watparser/WatParser.java b/src/de/inetsoftware/jwebassembly/watparser/WatParser.java index c2826b9..d0dec99 100644 --- a/src/de/inetsoftware/jwebassembly/watparser/WatParser.java +++ b/src/de/inetsoftware/jwebassembly/watparser/WatParser.java @@ -330,7 +330,7 @@ public class WatParser extends WasmCodeBuilder { throw new WasmException( "Unknown WASM token: " + tok, lineNumber ); } } - } catch( Exception ex ) { + } catch( Throwable ex ) { throw WasmException.create( ex, lineNumber ); } }