playcanvas / editor

Issue tracker for the PlayCanvas Editor
https://playcanvas.com/
154 stars 28 forks source link

Show an user facing error message when an entity cannot be copied #235

Open yaustar opened 3 years ago

yaustar commented 3 years ago

Attempt to copy a VERY large entity structure in the hierarchy, if it's too large, a console error occurs but no message is given to the user saying why it cannot be copied.

clipboard:set (editor.method error)
DOMException: Failed to execute 'setItem' on 'Storage': Setting the value of 'playcanvas_editor_clipboard' exceeded the quota.
    at LocalStorage.set (https://playcanvas.com/editor/scene/js/editor.js:9025:26)
    at Clipboard.set value [as value] (https://playcanvas.com/editor/scene/js/editor.js:9090:31)
    at https://playcanvas.com/editor/scene/js/editor.js:19534:25
    at Editor.call (https://playcanvas.com/editor/scene/js/editor.js:19421:42)
    at https://playcanvas.com/editor/scene/js/editor.js:30294:16
    at Editor.call (https://playcanvas.com/editor/scene/js/editor.js:19421:42)
    at Object.callback (https://playcanvas.com/editor/scene/js/editor.js:33787:20)
    at https://playcanvas.com/editor/scene/js/editor.js:20090:45
    at sentryWrapped (https://playcanvas.com/static/platform/js/sentry-libs/bundle.min.js:2:51229)

I can show this issue in a private project.

vkalpias commented 3 years ago

Oh interesting didn't know that can happen

yaustar commented 3 years ago

Same. The entity in question is crazy massive 😅 I struggled to find another project that would also break the clipboard.