mirror of
https://github.com/penpot/penpot.git
synced 2025-05-29 05:46:10 +02:00
✨ Allow importing token files with reference errors (#6374)
* ✨ Allow importing token files with reference errors * ✨ Add test for missing references
This commit is contained in:
parent
46709fb02e
commit
92f5b5f92b
2 changed files with 10 additions and 12 deletions
|
@ -314,11 +314,11 @@
|
|||
(resolve-tokens-with-errors+)
|
||||
(p/then (fn [_] tokens-lib))
|
||||
(p/catch (fn [sd-error]
|
||||
(let [reference-errors (reference-errors sd-error)
|
||||
err (if reference-errors
|
||||
(wte/error-ex-info :error.import/style-dictionary-reference-errors reference-errors sd-error)
|
||||
(wte/error-ex-info :error.import/style-dictionary-unknown-error sd-error sd-error))]
|
||||
(throw err)))))
|
||||
(let [reference-errors (reference-errors sd-error)]
|
||||
;; We allow reference errors for the users to resolve in the ui and throw on any other errors
|
||||
(if reference-errors
|
||||
(p/resolved tokens-lib)
|
||||
(throw (wte/error-ex-info :error.import/style-dictionary-unknown-error sd-error sd-error)))))))
|
||||
(catch js/Error e
|
||||
(p/rejected (wte/error-ex-info :error.import/style-dictionary-unknown-error "" e))))))))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue