Closed
Description
I would like to check if an error is an instance of Neo4jError
but using ìnstanceof` does not work.
const { Neo4jError } = require('neo4j-driver').v1;
const e = new Neo4jError('foo');
console.log(e instanceof Neo4jError); // false
This seems to be a known issue in babel. For now I've got a workaround that checks if there is a code
property on the error that starts with Neo.
.
This babel-transform might be a solution? https://github.com/loganfsmyth/babel-plugin-transform-builtin-extend/blob/master/src/index.js
Metadata
Metadata
Assignees
Labels
No labels