codex-team / codex-team/editor.js

When saving fails, editor.save() resolves the promise (instead of rejecting it)

Open
#2,608 2 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Steps to reproduce:
1. raise an exception in a Editor.js block in its save() method
2. Editor.js properly detects and logs the error in the console. For example: `Saving failed due to the Error TypeError: Cannot read properties of null (reading 'src')`
3. Editor.js then invokes and resolves the `editor.save().then()` promise with null content

**Expected behavior:**

Editor.js should reject the promise so that the `catch` code is executed for that promise.

**Actual behavior:**

Editor.js fulfill the promise and the `then` code block is executed for that promise.

**Device, Browser, OS**: All

**Editor.js version**: 2.29

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.