LearnNewsExamplesServices
Frontmatter
id6811
titleworker.mixin.RemoteMethodAccess: onRemoteMethod() => log errors for async function calls into the console
stateClosed
labels
enhancement
assigneestobiu
createdAtJun 16, 2025, 12:55 PM
updatedAtJun 16, 2025, 12:56 PM
githubUrlhttps://github.com/neomjs/neo/issues/6811
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 16, 2025, 12:56 PM

worker.mixin.RemoteMethodAccess: onRemoteMethod() => log errors for async function calls into the console

Closed v10.0.0-alpha.1 enhancement
tobiu
tobiu commented on Jun 16, 2025, 12:55 PM
        if (out instanceof Promise) {
            out
                /*
                 * Intended logic:
                 * If the code of a remote method fails, it would not show any errors inside the console,
                 * so we want to manually log the error for debugging.
                 * Rejecting the Promise gives us the chance to recover.
                 *
                 * Example:
                 * Neo.vdom.Helper.update(opts).catch(err => {
                 *     me.isVdomUpdating = false;
                 *     reject?.()
                 * }).then(data => {...})
                 */
                .catch(err => {console.error(err); me.reject(msg, err)})
                .then(data => {me.resolve(msg, data)})
        } else {
            me.resolve(msg, out)
        }
tobiu assigned to @tobiu on Jun 16, 2025, 12:55 PM
tobiu added the enhancement label on Jun 16, 2025, 12:55 PM
tobiu referenced in commit 1afddb7 - "worker.mixin.RemoteMethodAccess: onRemoteMethod() => log errors for async function calls into the console #6811" on Jun 16, 2025, 12:56 PM
tobiu closed this issue on Jun 16, 2025, 12:56 PM