Skip to content
Merged
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
5 changes: 3 additions & 2 deletions packages/core-bridge/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { isPromise } = require('node:util/types');
const { getPrebuiltPath } = require('./common');
const typescriptExports = require('./lib/index');
const { convertFromNamedError } = require('./lib/errors');
Expand All @@ -9,7 +10,7 @@ function wrapErrors(fn) {
return (...args) => {
try {
let res = fn(...args);
if (res instanceof Promise) {
if (isPromise(res)) {
return res.catch((e) => {
throw convertFromNamedError(e, false);
});
Expand Down Expand Up @@ -55,7 +56,7 @@ if (process.env.TEMPORAL_TRACE_NATIVE_CALLS?.toLowerCase() === 'true') {

let res = fn(...args);

if (res instanceof Promise) {
if (isPromise(res)) {
log(callid, `${fnname}() - received promise`);
return res.then(
(x) => {
Expand Down