nodejs: Remove the fclose() error handling (#261)
This commit is contained in:
parent
9059ba5ae2
commit
656d0c74a7
|
@ -147,17 +147,10 @@ Napi::Value LoadTrustedSetup(const Napi::CallbackInfo& info) {
|
||||||
|
|
||||||
// Load the trusted setup from that file
|
// Load the trusted setup from that file
|
||||||
C_KZG_RET ret = load_trusted_setup_file(&(data->settings), file_handle);
|
C_KZG_RET ret = load_trusted_setup_file(&(data->settings), file_handle);
|
||||||
|
|
||||||
// Close the trusted setup file
|
// Close the trusted setup file
|
||||||
if (fclose(file_handle) != 0) {
|
fclose(file_handle);
|
||||||
if (ret == C_KZG_OK) {
|
|
||||||
free_trusted_setup(&(data->settings));
|
|
||||||
}
|
|
||||||
Napi::Error::New(env, "Error closing trusted setup file").ThrowAsJavaScriptException();
|
|
||||||
return env.Undefined();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check that it was successful
|
// Check that loading the trusted setup was successful
|
||||||
if (ret != C_KZG_OK) {
|
if (ret != C_KZG_OK) {
|
||||||
Napi::Error::New(env, "Error loading trusted setup file: " + file_path).ThrowAsJavaScriptException();
|
Napi::Error::New(env, "Error loading trusted setup file: " + file_path).ThrowAsJavaScriptException();
|
||||||
return env.Undefined();
|
return env.Undefined();
|
||||||
|
|
Loading…
Reference in New Issue