Log init errors to the console (#11)

* Log init errors to the console

* Use stable @polkadot/util packages
This commit is contained in:
Jaco Greeff
2019-03-27 22:12:54 +01:00
committed by GitHub
parent a2e81acbd6
commit e668b96bca
9 changed files with 23 additions and 14 deletions
+9 -3
View File
@@ -69,7 +69,7 @@ export function waitReady(): Promise<boolean>;
# create the init promise handler
echo "
const asm = null; // require('./wasm_asm');
const pkg = require('./package.json');
const bytes = require('./wasm_wasm');
const js = require('./wasm');
@@ -79,7 +79,10 @@ module.exports = async function createExportPromise () {
};
if (!WebAssembly) {
return asm;
console.error(`ERROR: Unable to initialize ${pkg.name}, WebAssembly is not available in this environment`);
// TODO: Return asm version when not detected
return null;
}
try {
@@ -87,7 +90,10 @@ module.exports = async function createExportPromise () {
return instance.exports;
} catch (error) {
return asm;
console.error(`ERROR: Unable to initialize ${pkg.name}:: ${error.message}`);
// TODO: Return asm version here as a fallback
return null;
}
}
" > $BGJ
+1 -2
View File
@@ -16,12 +16,11 @@ for PKG in "${PACKAGES[@]}"; do
../../scripts/build-package.sh
./adjust.sh
../../scripts/test-package.sh
rm -rf build/*-e build/package.json build/README.md
ls -al build
../../scripts/test-package.sh
cd ..
fi
done