Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java: do not abort, but throw an exception in all cases in EvmcVm.create() #580

Merged
merged 1 commit into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
// Licensed under the Apache License, Version 2.0.
package org.ethereum.evmc;

/** Exception thrown when the EVMC binding or VM fails to load. */
public class EvmcLoaderException extends Exception {
public EvmcLoaderException(String message) {
super(message);
}

public EvmcLoaderException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ public static EvmcVm create(String filename) throws EvmcLoaderException {
System.load(System.getProperty("user.dir") + "/../c/build/lib/libevmc-java.so");
EvmcVm.isEvmcLibraryLoaded = true;
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
throw new EvmcLoaderException("EVMC JNI binding library failed to load", e);
}
}
if (Objects.isNull(evmcVm)) {
Expand Down